Re: [HACKERS] remove upsert example from docs

2011-02-17 Thread Bruce Momjian
Marko Tiikkaja wrote: On 2011-02-17 8:37 PM +0200, Bruce Momjian wrote: Marko Tiikkaja wrote: The problem with the safe way is that it's not safe if called in a transaction with isolation level set to SERIALIZABLE. Good analysis. Documentation patch attached and applied. The safe

Re: [HACKERS] Rewrite, normal execution vs. EXPLAIN ANALYZE

2011-02-17 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: The status of that patch is that Tom promised to look at it two months ago and hasn't. It would be nice if someone else could pick it up. I'm pedaling as fast as I can, honestly. regards, tom lane -- Sent via pgsql-hackers

Re: [HACKERS] SSI bug?

2011-02-17 Thread Dan Ports
On Wed, Feb 16, 2011 at 10:13:35PM +, YAMAMOTO Takashi wrote: i got the following SEGV when runnning vacuum on a table. (the line numbers in predicate.c is different as i have local modifications.) oldlocktag.myTarget was NULL. it seems that TransferPredicateLocksToNewTarget sometimes use

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 11:45 AM, Stephen Frost sfr...@snowman.net wrote: Robert, if you say this has to be punted to 9.2 again, I'm giving up. ;) Frankly, this patch has already consumed more than its fair share of my attention. Having said that, I've just spent some more time on it. I

[HACKERS] Coding style guide

2011-02-17 Thread Daniel Loureiro
Is there any official style guide of PostgreSQL code ? Like the google-styleguide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) ? Regards, -- Daniel Loureiro -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] default_tablespace

2011-02-17 Thread Florian Pflug
On Feb17, 2011, at 18:32 , David Kerr wrote: On Wed, Feb 16, 2011 at 03:59:13PM -0800, carl clemens wrote: - After reviewing docs and searching web - cannot find out how to determine the default tablespace - of a user? It doesn't appear to me that default tablespaces are assigned to a user,

Re: [HACKERS] tsearch Parser Hacking

2011-02-17 Thread Oleg Bartunov
David, as a cool perl guy you can easily take OpenFTS (openfts.sourceforge.net), which provides perl interface to tsearch datatypes, and develop a plperl version. That would be interesting for many people, who like flexibility of perl. We personally use openfts in our web projects,i.e., we use

Re: [HACKERS] default_tablespace

2011-02-17 Thread David Kerr
On Thu, Feb 17, 2011 at 08:55:55PM +0100, Florian Pflug wrote: - On Feb17, 2011, at 18:32 , David Kerr wrote: - On Wed, Feb 16, 2011 at 03:59:13PM -0800, carl clemens wrote: - - After reviewing docs and searching web - - cannot find out how to determine the default tablespace - - of a user? -

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Josh Berkus
Robert, It seems there's at least one more thing to worry about here, which is the overhead of this computation when CSV logging is in use. If no SET ROLE or SET SESSION AUTHORIZATION commands are in use, the code will call show_role(), which will return none. We'll then strcmp() that

Re: [HACKERS] default_tablespace

2011-02-17 Thread Alvaro Herrera
Excerpts from Florian Pflug's message of jue feb 17 16:55:55 -0300 2011: You can, however, do ALTER USER user SET default_tablespace=whatever, which will cause default_tablespace to be set automatically upon login for that user. I don't know of the top of my head how we store that in the

Re: [HACKERS] Rewrite, normal execution vs. EXPLAIN ANALYZE

2011-02-17 Thread David E. Wheeler
On Feb 17, 2011, at 11:28 AM, Tom Lane wrote: The status of that patch is that Tom promised to look at it two months ago and hasn't. It would be nice if someone else could pick it up. I'm pedaling as fast as I can, honestly Tom leaves everything on the road.

Re: [HACKERS] Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit.

2011-02-17 Thread Simon Riggs
On Thu, 2011-02-17 at 10:09 -0500, Tom Lane wrote: Simon Riggs si...@2ndquadrant.com writes: On Thu, 2011-02-17 at 00:53 +, Tom Lane wrote: Doesn't anybody around here pay attention to compiler warnings? If you see one, then I accept one was there. I didn't see one, and a full make

Re: [HACKERS] Coding style guide

2011-02-17 Thread Bruce Momjian
Daniel Loureiro wrote: Is there any official style guide of PostgreSQL code ? Like the google-styleguide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) ? There is the developers FAQ. -- Bruce Momjian br...@momjian.ushttp://momjian.us EnterpriseDB

Re: [HACKERS] Fwd: [JDBC] Weird issues when reading UDT from stored function

2011-02-17 Thread Lukas Eder
Hi Oliver There are two problems. The first problem is a plpgsql problem in that particular function. It's broken regardless of how you call it. Here's how to fix it [...] Thanks for insisting! I missed that fact. In the end, it looked like the same error, but you're right about the plpgsql

Re: [HACKERS] Coding style guide

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 3:55 PM, Bruce Momjian br...@momjian.us wrote: Daniel Loureiro wrote: Is there any official style guide of PostgreSQL code ? Like the google-styleguide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) ? There is the developers FAQ. There's also

Re: [HACKERS] Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit.

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 3:47 PM, Simon Riggs si...@2ndquadrant.com wrote: The only difference in messages I got was dbsize.c: In function ‘pg_relation_filepath’: dbsize.c:570: warning: ‘rnode.dbNode’ may be used uninitialized in this function dbsize.c:570: warning: ‘rnode.spcNode’ may be

Re: [HACKERS] Debian readline/libedit breakage

2011-02-17 Thread Martijn van Oosterhout
On Wed, Feb 16, 2011 at 04:33:19PM -0800, Joshua D. Drake wrote: Maybe we really should consider moving to NSS insread? http://www.mozilla.org/projects/security/pki/nss/ If it solves the license problem, it is well supported etc.. For the record, which library you choose only matters for a

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Simon Riggs
On Wed, 2011-02-16 at 11:34 +0900, Fujii Masao wrote: On Tue, Feb 15, 2011 at 7:13 AM, Daniel Farina dan...@heroku.com wrote: On Mon, Feb 14, 2011 at 12:48 AM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Feb 12, 2011 at 8:58 AM, Daniel Farina dan...@heroku.com wrote: Context diff

[HACKERS] Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

2011-02-17 Thread Jesper Krogh
Hi All. The NULL element always suprises me in unpleasant ways.. my brain simply cant really understand the logic, so please let me know if this is one of the cases where I just should spend way more efforts into fixing that instead. I have a table with a null_frac of 0.5 and i have tested

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 4:21 PM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, 2011-02-16 at 11:34 +0900, Fujii Masao wrote: On Tue, Feb 15, 2011 at 7:13 AM, Daniel Farina dan...@heroku.com wrote: On Mon, Feb 14, 2011 at 12:48 AM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Feb

Re: [HACKERS] btree_gist (was: CommitFest progress - or lack thereof)

2011-02-17 Thread Tom Lane
I wrote: In any case, I was pointing to that as a reason that btree_gist wasn't ready to be in core. It has nothing to do with KNN-ifying the module. I would like to see that happen before 9.1, else KNN will go out with not very many actual use-cases supported. However, a larger reason for

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: It seems there's at least one more thing to worry about here, which is the overhead of this computation when CSV logging is in use. If no SET ROLE or SET SESSION AUTHORIZATION commands are in use, the code will call show_role(), which will return

Re: [HACKERS] SSI bug?

2011-02-17 Thread Kevin Grittner
Dan Ports d...@csail.mit.edu wrote: Oops. Those are both definitely bugs (and my fault). Your patch looks correct. Thanks for catching that! Could a committer please apply the slightly modified version here?:

Re: [HACKERS] Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

2011-02-17 Thread Tom Lane
Jesper Krogh jes...@krogh.cc writes: When something evaluates to null isn't included in the result, shouldn't the query-planner then take the null_frac into account when computing the estimate? The proposed patch seems wrong to me: if we're estimating on the basis of most-common-value

Re: [HACKERS] Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

2011-02-17 Thread Jesper Krogh
On 2011-02-17 23:20, Tom Lane wrote: Jesper Kroghjes...@krogh.cc writes: When something evaluates to null isn't included in the result, shouldn't the query-planner then take the null_frac into account when computing the estimate? The proposed patch seems wrong to me: if we're estimating on

[HACKERS] ALTER TYPE COLLATABLE?

2011-02-17 Thread Tom Lane
I observe the following discrepancy between the 9.0 and 9.1 citext install scripts: *** *** 52,58 STORAGE= extended, -- make it a non-preferred member of string type category CATEGORY = 'S', ! PREFERRED = false ); -- --- 49,56

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Josh Berkus
So, in summary, the position is that we have a timeout, but that timeout doesn't work in all cases. But it does work in some, so that seems enough for me to say let's commit. Not committing gives us nothing at all, which is as much use as a chocolate teapot. Can someone summarize the cases

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Simon Riggs
On Thu, 2011-02-17 at 16:42 -0500, Robert Haas wrote: So, in summary, the position is that we have a timeout, but that timeout doesn't work in all cases. But it does work in some, so that seems enough for me to say let's commit. Not committing gives us nothing at all, which is as much

Re: [HACKERS] ALTER TYPE COLLATABLE?

2011-02-17 Thread David E. Wheeler
On Feb 17, 2011, at 2:50 PM, Tom Lane wrote: I observe the following discrepancy between the 9.0 and 9.1 citext install scripts: *** *** 52,58 STORAGE= extended, -- make it a non-preferred member of string type category CATEGORY = 'S', !

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alvaro Herrera
Excerpts from Alex Hunsaker's message of sáb feb 12 04:53:14 -0300 2011: - make plperl.o depend on plperl_helpers.h (should have been done in the utf8 patch) Incidentally, I think this bit was lost, no? -- Álvaro Herrera alvhe...@commandprompt.com The PostgreSQL Company - Command Prompt,

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Robert Haas robertmh...@gmail.com writes: It seems there's at least one more thing to worry about here, which is the overhead of this computation when CSV logging is in use. If no SET ROLE or SET SESSION AUTHORIZATION commands are in use, the code

Re: [HACKERS] Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

2011-02-17 Thread Tom Lane
Jesper Krogh jes...@krogh.cc writes: On 2011-02-17 23:20, Tom Lane wrote: The proposed patch seems wrong to me: if we're estimating on the basis of most-common-value fractions, the null_frac is already accounted for, because it's not part of the MCV selectivity fractions. IOW, aren't you

Re: [HACKERS] Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

2011-02-17 Thread Tom Lane
Jesper Krogh jes...@krogh.cc writes: Attached patch tries to align the behaviour Applied with a bit of editorialization. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alex Hunsaker
On Thu, Feb 17, 2011 at 16:18, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Alex Hunsaker's message of sáb feb 12 04:53:14 -0300 2011: - make plperl.o depend on plperl_helpers.h (should have been done in the utf8 patch) Incidentally, I think this bit was lost, no? It was,

Re: [HACKERS] Sync Rep for 2011CF1

2011-02-17 Thread Simon Riggs
On Fri, 2011-01-21 at 14:45 +0200, Heikki Linnakangas wrote: * The UI differs from what was agreed on here: http://archives.postgresql.org/message-id/4d1dcf5a.7070...@enterprisedb.com. Patch to add server_name parameter, plus mechanism to send info from standby to master. While doing that,

Re: [HACKERS] Debian readline/libedit breakage

2011-02-17 Thread Charles.McDevitt
On 02/17/2011 12:34 PM, Bruce Momjian wrote: Andrew Dunstan wrote: On 02/17/2011 12:13 PM, Bruce Momjian wrote: FWIW, the only interactively usable version of psql for windows I know of is the one that runs under Cygwin. It can be build with readline and works as expected. Uh, don't

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Fujii Masao
On Fri, Feb 18, 2011 at 7:55 AM, Josh Berkus j...@agliodbs.com wrote: So, in summary, the position is that we have a timeout, but that timeout doesn't work in all cases. But it does work in some, so that seems enough for me to say let's commit. Not committing gives us nothing at all, which is

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of mié feb 16 19:54:07 -0300 2011: I cleaned up the patch a bit -- result is v11, attached. I'll give it another look tomorrow and hopefully commit it. Applied. Thanks. -- Álvaro Herrera alvhe...@commandprompt.com The PostgreSQL Company - Command

Re: [HACKERS] contrib loose ends: 9.0 to 9.1 incompatibilities

2011-02-17 Thread Tom Lane
I wrote: Robert Haas robertmh...@gmail.com writes: I think we should try to make the state match as closely as possible, no matter how you got there. Otherwise, I think we're storing up a host of future pain for ourselves. Well, if you're willing to hold your nose for the UPDATE pg_proc

[HACKERS] Re: [COMMITTERS] pgsql: Hot Standby feedback for avoidance of cleanup conflicts on stand

2011-02-17 Thread Fujii Masao
On Thu, Feb 17, 2011 at 4:29 PM, Simon Riggs si...@2ndquadrant.com wrote: Something like the following description should be in the doc.      hot_standby_feedback has no effect if either hot_standby is off or      wal_receiver_status_interval is zero. The docs are going to need some work

[HACKERS] About the performance of startup after dropping many tables

2011-02-17 Thread Gan Jiadong
Hello guys, we have PG 8.3.13 in our system. When running performance cases, we find the startup recovery cost about 3 minutes. It is too long in our system. We diagnose the problem by adding timestamp. Finally, we find almost all 3 minutes were used by the relation dropping and buffer

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 4:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: It seems there's at least one more thing to worry about here, which is the overhead of this computation when CSV logging is in use.  If no SET ROLE or SET SESSION AUTHORIZATION

Re: [HACKERS] Replication server timeout patch

2011-02-17 Thread Robert Haas
On Thu, Feb 17, 2011 at 9:10 PM, Fujii Masao masao.fu...@gmail.com wrote: On Fri, Feb 18, 2011 at 7:55 AM, Josh Berkus j...@agliodbs.com wrote: So, in summary, the position is that we have a timeout, but that timeout doesn't work in all cases. But it does work in some, so that seems enough for

[HACKERS] WIP - Add ability to constrain backend temporary file space

2011-02-17 Thread Mark Kirkwood
Recently two systems here have suffered severely with excessive temporary file creation during query execution. In one case it could have been avoided by more stringent qa before application code release, whereas the other is an ad-hoc system, and err...yes. In both cases it would have been

Re: [HACKERS] About the performance of startup after dropping many tables

2011-02-17 Thread Tom Lane
Gan Jiadong ga...@huawei.com writes: we have PG 8.3.13 in our system. When running performance cases, we find the startup recovery cost about 3 minutes. It is too long in our system. Maybe you should rethink the assumption that dropping 4 tables is a cheap operation. Why do you have that

Re: [HACKERS] Add support for logging the current role

2011-02-17 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Feb 17, 2011 at 4:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: In short, add a bit of overhead at SetUserId time in order to make this cheap (and accurate) in elog.c. As Stephen says, I think this is utterly impractical; those routines can't

Re: [HACKERS] Initial review of xslt with no limits patch

2011-02-17 Thread Bruce Momjian
Tom Lane wrote: Mike Fowler m...@mlfowler.com writes: On 06/08/10 17:50, Pavel Stehule wrote: attached updated patch with regression test Bravely ignoring the quotation/varidic/favourite_scheme_here conversations, I've taken a look at the patch as is. Thanks to Tom's input I can now

Re: [HACKERS] COPY ENCODING revisited

2011-02-17 Thread Itagaki Takahiro
On Fri, Feb 18, 2011 at 04:04, Hitoshi Harada umi.tan...@gmail.com wrote: FWIW, I finally found the good example to cache miscellaneous data in file local, namely regexp.c. It allocates compiled regular expressions up to 32 by using malloc(). I'm not exactly sure the cache usage in mbutils.c

Re: [HACKERS] Initial review of xslt with no limits patch

2011-02-17 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: I think we have a few TODO items here: * Invent ... and document ... an API that permits safe assembly of a parameter list from non-constant (and perhaps untrustworthy) values. * Fix xslt_process' failure to report (some?) errors

Re: [HACKERS] CommitFest 2011-01 as of 2011-02-04

2011-02-17 Thread Shigeru HANADA
On Wed, 16 Feb 2011 11:22:04 +0900 Itagaki Takahiro itagaki.takah...@gmail.com wrote: Thanks comments. I've applied the COPY API patch. When I've used COPY TO for testing file_fdw, I got wrong result. # Actually csv_branches has only 10 rows. postgres=# copy (select * from csv_branches) to

Re: [HACKERS] Transaction-scope advisory locks

2011-02-17 Thread Itagaki Takahiro
On Thu, Feb 17, 2011 at 17:05, Itagaki Takahiro itagaki.takah...@gmail.com wrote: I did a few cosmetic fixes, mainly lmgr/README and make a subroutine ReleaseLockForOwner() for LockReleaseSession and LockReleaseCurrentOwner. Committed with a few typo fixes. Thanks, Marko! -- Itagaki Takahiro

Re: [HACKERS] CommitFest 2011-01 as of 2011-02-04

2011-02-17 Thread Itagaki Takahiro
On Fri, Feb 18, 2011 at 13:15, Shigeru HANADA han...@metrosystems.co.jp wrote: When I've used COPY TO for testing file_fdw, I got wrong result. It would be because DR_copy's processed is not initialized in CreateCopyDestReceiver().  Please see attached patch. Oops, thanks, applied. --

Re: [HACKERS] knngist - 0.8

2011-02-17 Thread Tom Lane
Teodor Sigaev teo...@sigaev.ru writes: I've applied all of this, and written documentation for all of it, Thank you a lot except for the contrib/btree_gist additions which still need to be redone for the revised API (and then documented!). My patience ran out Done, btree_gist is reworked

Re: [HACKERS] About the performance of startup after dropping many tables

2011-02-17 Thread Gan Jiadong
Hi, Thanks for your reply. Of course, we will think about whether 4 relations dropping is reasonable. In fact, this happens in a very special scenario . But when we analyzed this issue, we found the PG code can be rewritten to achieve better performance. Or we can say the arithmetic

Re: [HACKERS] About the performance of startup after dropping many tables

2011-02-17 Thread Gan Jiadong
Hi, Thanks for your reply. Of course, we will think about whether 4 relations dropping is reasonable. In fact, this happens in a very special scenario . But when we analyzed this issue, we found the PG code can be rewritten to achieve better performance. Or we can say the arithmetic

Re: [HACKERS] pika failing since the per-column collation patch

2011-02-17 Thread Tom Lane
=?iso-8859-1?Q?R=E9mi_Zara?= remi_z...@mac.com writes: Le 12 févr. 2011 à 18:51, Peter Eisentraut a écrit : It's only failing on this one machine, but there isn't anything platform-specific in this code, so I'd look for memory management faults on the code or a compiler problem. Try with

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-17 Thread Heikki Linnakangas
On 17.02.2011 14:30, Gurjeet Singh wrote: On Wed, Feb 16, 2011 at 6:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Gurjeet Singhsingh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:25 AM, Tom Lanet...@sss.pgh.pa.us wrote: The only reason you'd need that code is if you were trying to

<    1   2