[HACKERS] Why does analyze_new_cluster.sh use sleep?

2012-08-23 Thread Peter Eisentraut
The script analyze_new_cluster.sh output by pg_upgrade contains several sleep calls (see contrib/pg_upgrade/check.c). What is the point of this? If the purpose of this script is to get the database operational again as soon as possible, waiting a few seconds doing nothing surely isn't helping.

Re: [HACKERS] xlog file naming

2012-08-23 Thread Peter Eisentraut
On Tue, 2012-08-21 at 12:01 -0400, Robert Haas wrote: On Wed, Aug 15, 2012 at 8:43 PM, Bruce Momjian br...@momjian.us wrote: Are there any TODO items here? It's possible there's something we want to change here, but it's far from obvious what that thing is. Our WAL file handling is

Re: [HACKERS] new --maintenance-db options

2012-08-23 Thread Peter Eisentraut
On Sun, 2012-06-24 at 01:26 +0300, Peter Eisentraut wrote: About the new --maintenance-db options: Why was this option not added to createuser and dropuser? In the original discussion[0] they were mentioned, but it apparently never made it into the code. What should we do with this? Add

[HACKERS] to_timestamp() too loose?

2012-08-23 Thread Magnus Hagander
postgres=# select to_timestamp('2012-08-01', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select to_timestamp('2012-08-00', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select

Re: [HACKERS] plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https

2012-08-23 Thread Andres Freund
Hi, While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: andres@awork2:~$ psql -p 5435 -U postgres -h /var/run/postgresql test Timing is on. psql (9.1devel, server 9.1.5) Type help for help. test=# SELECT pg_backend_pid();

Re: [HACKERS] pg_stat_replication vs StandbyReplyMessage

2012-08-23 Thread Magnus Hagander
On Wed, Aug 15, 2012 at 5:39 PM, Bruce Momjian br...@momjian.us wrote: On Mon, Aug 15, 2011 at 01:03:35PM +0200, Magnus Hagander wrote: The pg_stat_replication view exposes all the fields in StandbyReplyMessage *except* for the timestamp when the message was generated. On an active system this

Re: [HACKERS] alter enum add value if not exists

2012-08-23 Thread Magnus Hagander
On Mon, Aug 20, 2012 at 4:52 PM, Andrew Dunstan and...@dunslane.net wrote: Here is a patch for this feature, which should alleviate some of the woes caused by adding labels not being transactional (and thus not allowing for the catching of errors). I haven't actually checked the code in

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Amit Kapila
From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Magnus Hagander Sent: Thursday, August 23, 2012 2:08 PM postgres=# select to_timestamp('2012-08-01', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=#

Re: [HACKERS] alter enum add value if not exists

2012-08-23 Thread Andrew Dunstan
On 08/23/2012 06:47 AM, Magnus Hagander wrote: On Mon, Aug 20, 2012 at 4:52 PM, Andrew Dunstan and...@dunslane.net wrote: Here is a patch for this feature, which should alleviate some of the woes caused by adding labels not being transactional (and thus not allowing for the catching of

Re: [HACKERS] alter enum add value if not exists

2012-08-23 Thread Magnus Hagander
On Thu, Aug 23, 2012 at 1:35 PM, Andrew Dunstan and...@dunslane.net wrote: On 08/23/2012 06:47 AM, Magnus Hagander wrote: On Mon, Aug 20, 2012 at 4:52 PM, Andrew Dunstan and...@dunslane.net wrote: Here is a patch for this feature, which should alleviate some of the woes caused by adding

Re: [HACKERS] alter enum add value if not exists

2012-08-23 Thread Andrew Dunstan
On 08/23/2012 07:39 AM, Magnus Hagander wrote: On Thu, Aug 23, 2012 at 1:35 PM, Andrew Dunstan and...@dunslane.net wrote: On 08/23/2012 06:47 AM, Magnus Hagander wrote: On Mon, Aug 20, 2012 at 4:52 PM, Andrew Dunstan and...@dunslane.net wrote: Here is a patch for this feature, which should

Re: [HACKERS] xlog file naming

2012-08-23 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Tue, 2012-08-21 at 12:01 -0400, Robert Haas wrote: It's possible there's something we want to change here, but it's far from obvious what that thing is. Our WAL file handling is ridiculously hard to understand, but the problem with changing it is

Re: [HACKERS] new --maintenance-db options

2012-08-23 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Sun, 2012-06-24 at 01:26 +0300, Peter Eisentraut wrote: About the new --maintenance-db options: Why was this option not added to createuser and dropuser? In the original discussion[0] they were mentioned, but it apparently never made it into the

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: postgres=# select to_timestamp('2012-08-01', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select to_timestamp('2012-08-00', '-mm-dd'); to_timestamp 2012-08-01

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Magnus Hagander
On Thu, Aug 23, 2012 at 3:42 PM, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: postgres=# select to_timestamp('2012-08-01', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select to_timestamp('2012-08-00',

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Thu, Aug 23, 2012 at 3:42 PM, Tom Lane t...@sss.pgh.pa.us wrote: to_timestamp is intentionally pretty loose. Personally, if I wanted sanity checking on a date string in any common format, I would just cast the string to timestamp(tz), and *not*

Re: [HACKERS] TRUE/FALSE vs true/false

2012-08-23 Thread Bruce Momjian
On Mon, Aug 20, 2012 at 03:09:08PM -0400, Robert Haas wrote: I have difficult believing that a change of this type, if implemented judiciously, is really going to create that much difficulty in back-patching. I don't do as much back-patching as Tom either (no one does), but most of the

Re: [HACKERS] GetSnapshotData() comments

2012-08-23 Thread Bruce Momjian
On Tue, Aug 21, 2012 at 11:48:19AM -0400, Robert Haas wrote: On Tue, Aug 14, 2012 at 5:41 PM, Bruce Momjian br...@momjian.us wrote: Did these comment updates ever get addressed? Partially. I just made a commit to clean up the rest of it. Thanks. -- Bruce Momjian br...@momjian.us

Re: [HACKERS] B-tree parent pointer and checkpoints

2012-08-23 Thread Bruce Momjian
On Tue, Aug 21, 2012 at 11:55:20AM -0400, Robert Haas wrote: On Wed, Aug 15, 2012 at 6:23 PM, Bruce Momjian br...@momjian.us wrote: Has this been addressed? A TODO? I don't think anything's been done about it. According to your email of October 11, 2011, you already did add a TODO for

Re: [HACKERS] TRUE/FALSE vs true/false

2012-08-23 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Mon, Aug 20, 2012 at 03:09:08PM -0400, Robert Haas wrote: I think the thing we need to look at is what percentage of our code churn is coming from stuff like this, versus what percentage of it is coming from other factors. If we change 250,000 lines

Re: [HACKERS] temporal support patch

2012-08-23 Thread Kevin Grittner
Jeff Davis pg...@j-davis.com wrote: On Tue, 2012-08-21 at 17:07 -0500, Kevin Grittner wrote: The fact that it has an unknown sequence number or timestamp for purposes of ordering visibility of transactions doesn't mean you can't show that it completed in an audit log. In other words, I

[HACKERS] size of .po changesets

2012-08-23 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue ago 23 11:01:05 -0400 2012: $ git diff --shortstat REL9_0_9 REL9_1_5 3186 files changed, 314847 insertions(+), 210452 deletions(-) $ git diff --shortstat REL9_1_5 REL9_2_BETA4 2037 files changed, 290919 insertions(+), 189487 deletions(-) However,

Re: [HACKERS] size of .po changesets

2012-08-23 Thread Roger Leigh
On Thu, Aug 23, 2012 at 11:21:35AM -0400, Alvaro Herrera wrote: Excerpts from Tom Lane's message of jue ago 23 11:01:05 -0400 2012: $ git diff --shortstat REL9_0_9 REL9_1_5 3186 files changed, 314847 insertions(+), 210452 deletions(-) $ git diff --shortstat REL9_1_5 REL9_2_BETA4

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-23 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: How about we fix the serializable versus HS Windows bugs in one patch, and then look at the other as a separate patch? If that's OK, I think this is ready, unless my message text can be improved. (And I will have a shot at my first

Re: [HACKERS] size of .po changesets

2012-08-23 Thread Tom Lane
Roger Leigh rle...@codelibre.net writes: On Thu, Aug 23, 2012 at 11:21:35AM -0400, Alvaro Herrera wrote: Yeah, IMHO .po files are handled pretty badly by SCMs. I wonder if we could reduce the amount of git churn caused by those files by simply removing all comment lines from these files as

Re: [HACKERS] 9.2RC1 wraps this Thursday ...

2012-08-23 Thread Andrew Dunstan
On 08/23/2012 12:40 AM, Tom Lane wrote: I wrote: ... I really can't take responsibility for any of this since I don't have a Windows development environment. One of the Windows- hacking committers needs to pick this issue up. Anyone? [ crickets ] I guess everybody who might take an

Re: [HACKERS] 9.2RC1 wraps this Thursday ...

2012-08-23 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 08/23/2012 12:40 AM, Tom Lane wrote: Anybody who wants to fix it is surely welcome to, but I'm not going to consider this item as a reason to postpone RC1. I'm not sure what you want done. I can test Amit's patch in a couple of Windows

Re: [HACKERS] sha1, sha2 functions into core?

2012-08-23 Thread Bruce Momjian
On Mon, Aug 20, 2012 at 07:08:12PM -0400, Tom Lane wrote: The only reason I can see for pushing more crypto into core is if we needed to stop using MD5 for the core password authentication functionality. While that might come to pass eventually, I am aware of no evidence whatever that SHAn,

Re: [HACKERS] 9.2RC1 wraps this Thursday ...

2012-08-23 Thread Andrew Dunstan
On 08/23/2012 01:58 PM, Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: On 08/23/2012 12:40 AM, Tom Lane wrote: Anybody who wants to fix it is surely welcome to, but I'm not going to consider this item as a reason to postpone RC1. I'm not sure what you want done. I can test Amit's

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-23 Thread Tom Lane
I wrote: I poked around this area a bit. I notice that check_transaction_read_only has got the same fundamental error: it thinks it can safely consult RecoveryInProgress(), which in general it cannot. After rereading the whole thread I saw that Heikki had already pointed this out, and come

Re: [HACKERS] size of .po changesets

2012-08-23 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue ago 23 13:33:46 -0400 2012: Roger Leigh rle...@codelibre.net writes: On Thu, Aug 23, 2012 at 11:21:35AM -0400, Alvaro Herrera wrote: Yeah, IMHO .po files are handled pretty badly by SCMs. I wonder if we could reduce the amount of git churn caused by

Re: [HACKERS] Large number of open(2) calls with bulk INSERT into empty table

2012-08-23 Thread Bruce Momjian
On Tue, Aug 21, 2012 at 09:52:02AM -0400, Robert Haas wrote: On Mon, Aug 20, 2012 at 6:44 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Aug 20, 2012 at 4:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: Surely we could just prevent creation of the FSM

Re: [HACKERS] TODO

2012-08-23 Thread Bruce Momjian
On Tue, Aug 21, 2012 at 12:16:11PM +0900, Tatsuo Ishii wrote: I found this in https://wiki.postgresql.org/wiki/Todo : Improve ability to display optimizer analysis using OPTIMIZER_DEBUG What does this actually mean? Add GUC switch to enable optimizer debug on/off? More fancy/useful

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-23 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: I tweaked Kevin's error message to keep the same capitalization as the existing text for the message in check_XactIsoLevel --- if we change that it will cause work for the translators, and I don't think it's enough of an improvement to justify that.

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-23 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: I'll run through my tests again tonight, against your patch, not that I expect any problems with it. Unfortunately I can't test Windows, as I don't have a build environment for that. FWIW, you can approximate Windows close enough for this

[HACKERS] pg_upgrade's exec_prog() coding improvement

2012-08-23 Thread Alvaro Herrera
Hi, I've been bitten twice by exec_prog()s API, so here's a patch to try to make it a bit harder to misuse. There are two main changes here; one is to put the logfile option as the first argument; then comes a bool, then the format string. This means you get a warning if you pass the wrong

Re: [HACKERS] [WIP] Performance Improvement by reducing WAL for Update Operation

2012-08-23 Thread Bruce Momjian
On Wed, Aug 22, 2012 at 07:38:33PM +0530, Amit Kapila wrote: I had made sure no full_page_write happens by making checkpoint interval and checkpoints segments longer. Original code - 1.8GModified code - 1.1G Diff - 63% reduction, incase of fill factor 100. Original code - 1.6G

Re: [HACKERS] Is this an appropriate item?

2012-08-23 Thread Bruce Momjian
On Thu, Aug 23, 2012 at 11:46:38AM +0900, Tatsuo Ishii wrote: On Wed, Aug 22, 2012 at 9:32 PM, Tatsuo Ishii is...@postgresql.org wrote: Hi, I found following item in the Developer FAQ. I don't see why this is related to developers.

Re: [HACKERS] Why does analyze_new_cluster.sh use sleep?

2012-08-23 Thread Bruce Momjian
On Thu, Aug 23, 2012 at 02:17:44AM -0400, Peter Eisentraut wrote: The script analyze_new_cluster.sh output by pg_upgrade contains several sleep calls (see contrib/pg_upgrade/check.c). What is the point of this? If the purpose of this script is to get the database operational again as soon as

Re: [HACKERS] 9.2RC1 wraps this Thursday ...

2012-08-23 Thread Andrew Dunstan
On 08/23/2012 02:44 PM, Andrew Dunstan wrote: On 08/23/2012 01:58 PM, Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: On 08/23/2012 12:40 AM, Tom Lane wrote: Anybody who wants to fix it is surely welcome to, but I'm not going to consider this item as a reason to postpone RC1.

Re: [HACKERS] TODO

2012-08-23 Thread Josh Berkus
Well, right now, OPTIMIZER_DEBUG lets you see what plans were considered and removed. I was thinking that information should be available without a special compiled binary. +1. It would also be popular with our academic users. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com

Re: [HACKERS] TODO

2012-08-23 Thread Peter Geoghegan
On 23 August 2012 20:21, Bruce Momjian br...@momjian.us wrote: On Tue, Aug 21, 2012 at 12:16:11PM +0900, Tatsuo Ishii wrote: I found this in https://wiki.postgresql.org/wiki/Todo : Improve ability to display optimizer analysis using OPTIMIZER_DEBUG What does this actually mean? Add GUC

[HACKERS] Recently noticed documentation issues

2012-08-23 Thread Craig Ringer
Hi all I've recently noticed two oversights in the docs that I'd like to fix. First, in sql-fetch, there's no hint that the cursor name can be the quoted value of a refcursor, eg: FETCH ALL FROM unnamed portal 1; This *is* shown in an example in plpgsql-cursors, but only in some

Re: [HACKERS] Outdated Japanse developers FAQ

2012-08-23 Thread Tatsuo Ishii
On Tue, Aug 21, 2012 at 7:49 AM, Tatsuo Ishii is...@postgresql.org wrote: Please let me know if this is not the right place to ask this kind of queston. PostgreSQL Developers FAQ in Japanese: http://wiki.postgresql.org/wiki/Developer_FAQ/ja looks pretty outdated. It was last updated on 7

Re: [HACKERS] default_isolation_level='serializable' crashes on Windows

2012-08-23 Thread Kevin Grittner
Tom Lane wrote: Kevin Grittner writes: I'll run through my tests again tonight, against your patch, not that I expect any problems with it. Unfortunately I can't test Windows, as I don't have a build environment for that. FWIW, you can approximate Windows close enough for this type of

Re: [HACKERS] Why does analyze_new_cluster.sh use sleep?

2012-08-23 Thread Peter Eisentraut
On Thu, 2012-08-23 at 17:05 -0400, Bruce Momjian wrote: On Thu, Aug 23, 2012 at 02:17:44AM -0400, Peter Eisentraut wrote: The script analyze_new_cluster.sh output by pg_upgrade contains several sleep calls (see contrib/pg_upgrade/check.c). What is the point of this? If the purpose of this

Re: [HACKERS] size of .po changesets

2012-08-23 Thread Peter Eisentraut
On Thu, 2012-08-23 at 11:21 -0400, Alvaro Herrera wrote: Yeah, IMHO .po files are handled pretty badly by SCMs. By SCMs that store diffs internally, perhaps, but Git doesn't, so I don't think it matters much for storage whether .po files diff well. I wonder if we could reduce the amount of

Re: [HACKERS] [WIP] Performance Improvement by reducing WAL for Update Operation

2012-08-23 Thread Amit Kapila
From: Bruce Momjian [mailto:br...@momjian.us] Sent: Friday, August 24, 2012 2:12 AM On Wed, Aug 22, 2012 at 07:38:33PM +0530, Amit Kapila wrote: I had made sure no full_page_write happens by making checkpoint interval and checkpoints segments longer. Original code - 1.8GModified

Re: [HACKERS] Recently noticed documentation issues

2012-08-23 Thread Amit Kapila
From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Craig Ringer Sent: Friday, August 24, 2012 7:17 AM I've recently noticed two oversights in the docs that I'd like to fix. First, in sql-fetch, there's no hint that the cursor name can be the

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: Hi, While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: andres@awork2:~$ psql -p 5435 -U postgres -h /var/run/postgresql test Timing is on. psql (9.1devel,

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In fact it can be used to crash the server: Um ... how exactly

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 07:19:42 AM Andres Freund wrote: On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Um ... how exactly can that happen, if the signal is now ignored? My man 2 signal tells me: According to POSIX, the behavior of a process is undefined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(2) or

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 07:33:01 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Um ... how exactly can that happen, if the signal is now ignored? My man 2 signal tells me: According to POSIX, the behavior of a process is undefined after it ignores a SIGFPE, SIGILL,