Re: [GENERAL] Postgres forums ... take 2

2010-11-17 Thread Magnus Hagander
On Wed, Nov 17, 2010 at 00:00, Elliot Chance wrote: > > On 17/11/2010, at 6:22 AM, Stephen Cook wrote: > >> On 11/16/2010 10:51 AM, Magnus Hagander wrote: >>> What I'm more interested in is still a word from the people who would >>> actually *use* a forum on how this would be better than sites lik

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Karsten Hilbert
On Tue, Nov 16, 2010 at 10:25:13PM -0500, Tom Lane wrote: > 4. The last bit of discussion on -hackers concerned what to do in > the case where the server got shut down cleanly. If it was shut > down cleanly, then any data for unlogged tables would have been > written out from shared buffers ... b

[GENERAL] Hotel room for FOSDEM 2011 in Brussels

2010-11-17 Thread Andreas 'ads' Scherbaum
Hello, like the last years I contacted a hotel in Brussels and reserved a number rooms for the upcoming FOSDEM next year. If you need a room please drop me a mail at mailto:a...@pgug.de until end of 2010 (2010-12-31). Please include your name, how many rooms you need and if you want a singl

[GENERAL] Read binary records

2010-11-17 Thread pasman pasmański
Hello. How to read binary file ? I try pg_read_file() but this returns text (not bytea) and skip part of record pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Yeb Havinga
On 2010-11-17 02:55, Josh Berkus wrote: If you do wish to have the data tossed out for no good reason every so often, then there ought to be a separate attribute to control that. I'm really having trouble seeing how such behavior would be desirable enough to ever have the server do it for you, o

Re: [GENERAL] Postgres forums ... take 2

2010-11-17 Thread Elliot Chance
Some more changes: * Added a profile field so you can enter your real name. Your real name is public but optional. If your real name is present then emails sent to the mailing list will use that instead of your forum name. * Mail parsing script will automatically pick up your real name. This me

Re: [GENERAL] where is pg_stat_activity (and others) in the documentation?

2010-11-17 Thread tv
>> You can find out exactly what you're waiting for by correlating this to >> the >> pg_locks table. >> Grab the 'procpid' of your waiting query and run: >> select * from pg_locks where pid= and granted='f'; >> Notice, in the pg_locks table, the logic works slightly different... >> if >> you'

[GENERAL] clarification regarding max_standby_streaming_delay

2010-11-17 Thread Rajesh Kumar Mallah
Hi, We have a setup Streaming Replication with max_standby_streaming_delay=120s if statements are getting canceled with on the standby server with messages like below: FATAL: terminating connection due to conflict with recovery DETAIL: User query might have needed to see row versions that must

[GENERAL] interactive pager off

2010-11-17 Thread Gauthier, Dave
How does one set pager off in interactive sql ? I tried \set pager off, doesn't seem to work. Thanks in Advance !

[GENERAL] Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread rmd22
Is it possible to modify source code in executor to keep a log of old tuples and new tuples after an UPDATE, INSERT or DELETE command is executed? (so basically Store Old Tuple Values -> UPDATE/INSERT/DELETE Command -> Store New Tuple Values) For example is it possible to modify the execMain.c fi

Re: [GENERAL] Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread Matthew Walden
You can create a trigger on the table to store the old/new values in an audit table if that is what you mean?

Re: [GENERAL] interactive pager off

2010-11-17 Thread Matthew Walden
On Wed, Nov 17, 2010 at 2:45 PM, Gauthier, Dave wrote: > How does one set pager off in interactive sql ? > > I tried \set pager off, doesn't seem to work. > > > > Thanks in Advance ! > \pset pager off

Re: [GENERAL] where is pg_stat_activity (and others) in the documentation?

2010-11-17 Thread Tom Lane
t...@fuzzy.cz writes: >> I do think that we need per-column documentation of the Standard >> Statistics Views. > What's wrong with these docs? > http://www.postgresql.org/docs/9/static/catalogs.html Or, more to the point, these docs: http://developer.postgresql.org/pgdocs/postgres/monitoring-stat

Re: [GENERAL] median for postgresql 8.3

2010-11-17 Thread Dean Rasheed
On 16 November 2010 17:37, Pavel Stehule wrote: > Hello > > see > http://okbob.blogspot.com/2009/11/aggregate-function-median-in-postgresql.html > An 8.3-compatible way of doing it is: SELECT CASE WHEN c % 2 = 0 AND c > 1 THEN (a[1]+a[2])/2 ELSE a[1] END FROM ( SELECT ARRAY(SELECT a FROM milro

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-17 Thread Tony Caduto
On 11/15/2010 5:53 PM, Lee Hachadoorian wrote: If anyone's interested, I've started accessing the postgres list through gmane.org (along with several other mailing lists I subscribe to). It's gives you the choice of reading the list as a threaded archive, a blog, or through an NNTP newsreader or

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Derrick Rice
On Wed, Nov 17, 2010 at 8:20 AM, Yeb Havinga wrote: > That sounds an awful lot like temporary tables. A lot like a GLOBAL temporary table, which isn't currently supported. Is there a difference between a global temporary table (if such a thing existed in PostgreSQL) and an unlogged table? Der

Re: [GENERAL] Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread Andreas Kretschmer
Matthew Walden wrote: > You can create a trigger on the table to store the old/new values in an audit > table if that is what you mean? Or he can use tablelog: 16:36 < akretschmer|home> ??tablelog 16:36 < pg_docbot> For information about 'tablelog' see: 16:36 < pg_docbot> http://pgfoundry.org/p

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Scott Mead
On Tue, Nov 16, 2010 at 10:25 PM, Tom Lane wrote: > Man, the number of misunderstandings in this thread is staggering. > Let me try to explain what the proposed feature will and will not do. > > 1. The system catalog entries for all tables will be wal-logged. > So schema (DDL) will survive a cras

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Scott Mead
On Wed, Nov 17, 2010 at 10:38 AM, Scott Mead wrote: > On Tue, Nov 16, 2010 at 10:25 PM, Tom Lane wrote: > >> Man, the number of misunderstandings in this thread is staggering. >> Let me try to explain what the proposed feature will and will not do. >> >> 1. The system catalog entries for all tab

Re: [GENERAL] median for postgresql 8.3

2010-11-17 Thread Pavel Stehule
2010/11/17 Dean Rasheed : > On 16 November 2010 17:37, Pavel Stehule wrote: >> Hello >> >> see >> http://okbob.blogspot.com/2009/11/aggregate-function-median-in-postgresql.html >> > > An 8.3-compatible way of doing it is: > > SELECT CASE WHEN c % 2 = 0 AND c > 1 THEN (a[1]+a[2])/2 ELSE a[1] END >

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-17 Thread Magnus Hagander
On Wed, Nov 17, 2010 at 15:09, Tony Caduto wrote: > On 11/15/2010 5:53 PM, Lee Hachadoorian wrote: >> >> If anyone's interested, I've started accessing the postgres list through >> gmane.org (along with several other mailing lists I subscribe to). It's >> gives you the choice of reading the list a

[GENERAL] Re: Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread rmd22
Yes I have tried it with triggers but I have to do it without using triggers. Since in my workplace someone has already done that and for some reason (may be because triggers are expensive i suppose...not sure though), hence they want me to do it by modifying the source code. -- View this message

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Tom Lane
Derrick Rice writes: > Is there a difference between a global temporary table (if such a thing > existed in PostgreSQL) and an unlogged table? Yes --- IIRC, a "global temp table" per spec has session-local contents. An unlogged table acts just like any other table except with respect to crash saf

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Steve Crawford
On 11/16/2010 07:25 PM, Tom Lane wrote: Man, the number of misunderstandings in this thread is staggering First, I have plenty of processes that I would immediately convert to using this (and, FWIW, none of them would benefit from preserving data across restarts). But I have some que

[GENERAL] Re: Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Ivan Voras
On 11/17/10 01:23, Scott Ribe wrote: On Nov 16, 2010, at 3:46 PM, Josh Berkus wrote: ...and will be truncated (emptied) on database restart. I think that's key. Anything that won't survive a database restart, I sure don't expect to survive backup& restore. FWIW, I agree with this reason

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-17 Thread Fredric Fredricson
On 11/17/2010 03:09 PM, Tony Caduto wrote: On 11/15/2010 5:53 PM, Lee Hachadoorian wrote: If anyone's interested, I've started accessing the postgres list through gmane.org (along with several other mailing lists I subscribe to). It's gives you the choice of reading the list as a threaded archiv

[GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Aram Fingal
I have a table where I should have declared a foreign key with ON UPDATE CASCADE and didn't. Now I want to fix that. From the documentation on www.postgresql.org, about ALTER TABLE it's not at all clear how to do this or even whether you can do this. -Aram -- Sent via pgsql-general mailing

[GENERAL] Re: Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Ivan Voras
On 11/17/10 02:55, Josh Berkus wrote: If you do wish to have the data tossed out for no good reason every so often, then there ought to be a separate attribute to control that. I'm really having trouble seeing how such behavior would be desirable enough to ever have the server do it for you, o

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Adrian Klaver
On 11/17/2010 08:32 AM, Aram Fingal wrote: I have a table where I should have declared a foreign key with ON UPDATE CASCADE and didn't. Now I want to fix that. From the documentation on www.postgresql.org, about ALTER TABLE it's not at all clear how to do this or even whether you can do this

Re: [GENERAL] Re: Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread A.M.
On Nov 17, 2010, at 11:32 AM, Ivan Voras wrote: > On 11/17/10 02:55, Josh Berkus wrote: >> >>> If you do wish to have the data tossed out for no good reason every so >>> often, then there ought to be a separate attribute to control that. I'm >>> really having trouble seeing how such behavior wo

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread David Fetter
On Wed, Nov 17, 2010 at 11:32:32AM -0500, Aram Fingal wrote: > I have a table where I should have declared a foreign key with ON > UPDATE CASCADE and didn't. Now I want to fix that. From the > documentation on www.postgresql.org, about ALTER TABLE it's not at > all clear how to do this or even wh

Re: [GENERAL] where is pg_stat_activity (and others) in the documentation?

2010-11-17 Thread Tomas Vondra
Dne 17.11.2010 16:22, Tom Lane napsal(a): > t...@fuzzy.cz writes: >>> I do think that we need per-column documentation of the Standard >>> Statistics Views. > >> What's wrong with these docs? >> http://www.postgresql.org/docs/9/static/catalogs.html > > Or, more to the point, these docs: > http://

Re: [GENERAL] Re: Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread David Fetter
On Wed, Nov 17, 2010 at 07:37:09AM -0800, rmd22 wrote: > Yes I have tried it with triggers but I have to do it without using > triggers. Since in my workplace someone has already done that and > for some reason (may be because triggers are expensive i > suppose...not sure though), hence they want

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Tom Lane
Steve Crawford writes: > 1. Would there be restrictions preventing a standard table from having a > FK or other constraint that depends on an unlogged table? If not, it > seems like there could be an unwanted ripple-effect from lost of the > unlogged table. I would assume that we should disall

Re: [GENERAL] Read binary records

2010-11-17 Thread David W Noon
On Wed, 17 Nov 2010 13:56:19 +0100, pasman pasmański wrote about [GENERAL] Read binary records: >How to read binary file ? >I try pg_read_file() but this returns text >(not bytea) and skip part of record I have written a set of file processing functions. As far as I'm concerned that code can be

[GENERAL] Re: Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread rmd22
Yes it's the "performance issue". I am going to talk to them about the triggers tomorrow. On the other hand I would still like to know if it is possible to do it by modifying the execMain.c or nodeModifyTable.c files? And also what about fast path interface? Is it possible to use it instead? --

Re: [GENERAL] Re: Storing old and new tuple values after an UPDATE, INSERT or DELETE

2010-11-17 Thread David Fetter
On Wed, Nov 17, 2010 at 09:17:39AM -0800, rmd22 wrote: > > Yes it's the "performance issue". > I am going to talk to them about the triggers tomorrow. On the > other hand I would still like to know if it is possible to do it by > modifying the execMain.c or nodeModifyTable.c files? Yes, but it'

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Richard Broersma
On Wed, Nov 17, 2010 at 8:43 AM, David Fetter wrote: > You can do it like this: > > BEGIN; > ALTER TABLE foo DROP CONSTRAINT your_constraint; > ALTER TABLE foo ADD FOREIGN KEY ...; > COMMIT; The nice thing about the ALTER TABLE statement is that you can do it in one command: ALTER TABLE foo DR

[GENERAL] Trying to obtain the intersect of two tsvector values

2010-11-17 Thread Allan Kamau
I have two tables forming a parent-child relationship, in my case a child entity could appear to have multiple parent records. Given records of the parent table, I would like to perform a pairwise determination of shared children between each such pair. I am thinking of using full text search for

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Josh Berkus
As was already mentioned, application logs. Unlogged tables would be perfect for that, provided they don't go *poof* every now and then for no good reason. Nobody's going to be too heart broken if a handful of log records go missing, or get garbled, after a server crash or power outage. Delete '

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Andreas Kretschmer
Richard Broersma wrote: > On Wed, Nov 17, 2010 at 8:43 AM, David Fetter wrote: > > > You can do it like this: > > > > BEGIN; > > ALTER TABLE foo DROP CONSTRAINT your_constraint; > > ALTER TABLE foo ADD FOREIGN KEY ...; > > COMMIT; > > The nice thing about the ALTER TABLE statement is that you

Re: [GENERAL] Trying to obtain the intersect of two tsvector values

2010-11-17 Thread Allan Kamau
On Wed, Nov 17, 2010 at 8:44 PM, Allan Kamau wrote: > I have two tables forming a parent-child relationship, in my case a > child entity could appear to have multiple parent records. > > Given records of the parent table, I would like to perform a pairwise > determination of shared children betwee

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Aram Fingal
On Nov 17, 2010, at 12:42 PM, Richard Broersma wrote: > ALTER TABLE foo > DROP CONSTRAINT your_constraint, > ADD CONSTRAINT your_constraint FOREIGN KEY ... > ON UPDATE CASCADE ON DELETE RESTRICT; Thanks. That worked. -Aram -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Glen Parker
On 11/16/2010 07:25 PM, Tom Lane wrote: 2. What's proposed as the new feature is that specific non-system tables can be marked as unlogged, meaning that WAL entries won't be made for changes in those tables' contents (nor their indexes' contents). So we can't guarantee that the contents of such

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Scott Mead
On Wed, Nov 17, 2010 at 12:49 PM, Josh Berkus wrote: > > As was already mentioned, application logs. Unlogged tables would be >> perfect for that, provided they don't go *poof* every now and then for >> no good reason. Nobody's going to be too heart broken if a handful of >> log records go missi

Re: [GENERAL] Counting boolean values (how many true, how many false)

2010-11-17 Thread Marc Mamin
sum(case when fair then 1 else 0 end) as fair, => sum(case when fair then 1 end) as fair, :) regards, Marc Mamin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Can you check in SQL if a fields can be encoded using specified charset

2010-11-17 Thread Dimitri Fontaine
Paul Taylor writes: > Is there a function that can say whether a textvalue can be encoded in a > particular charset See convert() and friends here: http://www.postgresql.org/docs/9.0/interactive/functions-string.html#FUNCTIONS-STRING-OTHER That will issue an error when the text can't be con

Re: [GENERAL] Adding data from mysql to postgresql periodically

2010-11-17 Thread Dimitri Fontaine
Hi, franrtorres77 writes: > I need to add periodically some data from a remote mysql database into our > postgresql database. So, does anyone know how to do it having in mind that > it must be runned every minute or so for adding new records to the > postresql? I've been doing that with pgloader

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Marc Mamin
I would like to choose the table behaviour on restart (restore/forget it) Currently, I'm looking for a way to split large transaction on different threads (with dblink). AN issue is to efficiently share temp data across the threads. unlogged tables would be here fine, something like glo

Re: [GENERAL] Linux x Windows LOCALE/ENCODING compatibility

2010-11-17 Thread Marco Colombo
On 11/09/2010 02:31 AM, Carlos Henrique Reimer wrote: Hi, I'm currently in the process of moving the data from the Windows server to the new Linux box but facing some problems with the encoding. Additional configuration information: Windows is running PG 8.3 and the new Linux box is PG 8.4. Wi

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Marc Mamin
Hello, another question. I haven't read the complete threads, so I apologize if this was already discussed. Will it be possible to switch from unlogged to logged ? To improve COPY performances, I currently: - make a copy of heavily indexed tables - load new data in the shadow table - add the

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Tom Lane
"Marc Mamin" writes: > Will it be possible to switch from unlogged to logged ? Probably not, because it would completely confuse hot standby slaves (or anything else looking at the WAL replay stream). You can't just start issuing WAL records against an already-built table or index, because the W

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Marc Mamin
yep, but I'll miss this as I only use WAL for crash recovery... regards, Marc Mamin -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Mittwoch, 17. November 2010 23:40 To: Marc Mamin Cc: PostgreSQL general; Josh Berkus Subject: Re: [GENERAL] Survey on backing up unlog

[GENERAL] Re: Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Ivan Voras
On 11/17/10 17:43, A.M. wrote: On Nov 17, 2010, at 11:32 AM, Ivan Voras wrote: On 11/17/10 02:55, Josh Berkus wrote: If you do wish to have the data tossed out for no good reason every so often, then there ought to be a separate attribute to control that. I'm really having trouble seeing h

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Merlin Moncure
On Tue, Nov 16, 2010 at 5:46 PM, Josh Berkus wrote: > Folks, > > Please help us resolve a discussion on -hackers. > > PostgreSQL 9.1 is likely to have, as a feature, the ability to create > tables which are "unlogged", meaning that they are not added to the > transaction log, and will be truncated

[GENERAL] feature request: log bytes out for each request

2010-11-17 Thread Aleksey Tsalolikhin
Hi. Could you please consider logging size of reply, like Apache httpd does with its logfile? We've started having intermittent spikes in network usage (the network interface on the DB server is getting maxed out) and I suspect there is a single very large query (just a working hypothesis at this

[GENERAL] ERROR row is too big size 9336, exceeds size 8160 when populating record with tsquery and tsvector fields

2010-11-17 Thread Allan Kamau
Hi, I am experiencing the "row is too big" error (with postgreSQL-9.0.1) when populating a table having a tsquery and tsvector fields. Are fields of tsquery and tsvector datatypes affected by this row size restriction? Allan. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] ERROR row is too big size 9336, exceeds size 8160 when populating record with tsquery and tsvector fields

2010-11-17 Thread Tom Lane
Allan Kamau writes: > I am experiencing the "row is too big" error (with postgreSQL-9.0.1) > when populating a table having a tsquery and tsvector fields. Could we see the exact declaration of your table, please? Did you play games with the STORAGE attribute of any of your columns?

Re: [GENERAL] ERROR row is too big size 9336, exceeds size 8160 when populating record with tsquery and tsvector fields

2010-11-17 Thread Joshua D. Drake
On Thu, 2010-11-18 at 07:37 +0300, Allan Kamau wrote: > Hi, > I am experiencing the "row is too big" error (with postgreSQL-9.0.1) > when populating a table having a tsquery and tsvector fields. > Are fields of tsquery and tsvector datatypes affected by this row size > restriction? Uhh... what ind

Re: [GENERAL] ERROR row is too big size 9336, exceeds size 8160 when populating record with tsquery and tsvector fields

2010-11-17 Thread Allan Kamau
On Thu, Nov 18, 2010 at 8:35 AM, Tom Lane wrote: > Allan Kamau writes: >> I am experiencing the "row is too big" error (with postgreSQL-9.0.1) >> when populating a table having a tsquery and tsvector fields. > > Could we see the exact declaration of your table, please?  Did you > play games with

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Alban Hertroys
On 16 Nov 2010, at 23:46, Josh Berkus wrote: > Folks, > > Please help us resolve a discussion on -hackers. > > PostgreSQL 9.1 is likely to have, as a feature, the ability to create > tables which are "unlogged", meaning that they are not added to the > transaction log, and will be truncated (emp