Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Fujii Masao
On Fri, Mar 4, 2011 at 3:16 PM, Simon Riggs si...@2ndquadrant.com wrote: CommitTransaction() calls HOLD_INTERRUPT() and then RESUME_INTERRUPTS(), which was reasonable before we started waiting for syncrep. The interrupt does occur *before* we send the message back, but doesn't work effectively

Re: [HACKERS] Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum

2011-03-04 Thread daveg
On Thu, Mar 03, 2011 at 09:04:04AM -0600, Merlin Moncure wrote: On Thu, Mar 3, 2011 at 2:16 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 03.03.2011 09:12, daveg wrote: Question: what would be the consequence of simply patching out the setting of this flag?

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Dimitri Fontaine
Hi, Tom Lane t...@sss.pgh.pa.us writes: However, it does strike me that there is one simple case we could support without a great deal of sweat. Namely, what if we allow non-superusers to create an extension if all the commands in the script are ones they could execute anyway? In

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Simon Riggs
On Fri, 2011-03-04 at 17:34 +0900, Fujii Masao wrote: On Fri, Mar 4, 2011 at 3:16 PM, Simon Riggs si...@2ndquadrant.com wrote: CommitTransaction() calls HOLD_INTERRUPT() and then RESUME_INTERRUPTS(), which was reasonable before we started waiting for syncrep. The interrupt does occur

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Simon Riggs
On Fri, 2011-03-04 at 16:42 +0900, Fujii Masao wrote: On Fri, Mar 4, 2011 at 12:02 AM, Fujii Masao masao.fu...@gmail.com wrote: Though I've not read whole of the patch yet, here is the current comment: Here are another comments: +#replication_timeout_client = 120 # 0 means wait forever

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Simon Riggs
On Fri, 2011-03-04 at 10:51 +, Simon Riggs wrote: + else if (timeout 0 + TimestampDifferenceExceeds(GetCurrentTransactionStopTimestamp(), + wait_start,

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Yeb Havinga
On 2011-03-03 11:53, Simon Riggs wrote: Latest version of Sync Rep, which includes substantial internal changes and simplifications from previous version. (25-30 changes). Testing more with the post v19 version from github with HEAD commit 009875662e1b47012e1f4b7d30eb9e238d1937f6 Author: Simon

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Simon Riggs
On Fri, 2011-03-04 at 12:24 +0100, Yeb Havinga wrote: On 2011-03-03 11:53, Simon Riggs wrote: Latest version of Sync Rep, which includes substantial internal changes and simplifications from previous version. (25-30 changes). Testing more with the post v19 version from github with HEAD

Re: [HACKERS] Open unmatch source file when step into parse_analyze() in Eclipse?

2011-03-04 Thread hom
Thanks Heikki Linnakangas :) Search for duplicate source files option works fine in my eclipse, but in my friend's eclipse, it still finds wrong source file. And there is another problem: when I debug step in the scanner_init(), Eclipse always finds scan.l and the excute order is still

[HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Marios Vodas
C doesn't break on free(NULL) so why is pfree developed to break on NULL? Is there any way in PostgreSQL to overcome this so that it won't break, apart from checking if the pointer NULL?

Re: [HACKERS] Open unmatch source file when step into parse_analyze() in Eclipse?

2011-03-04 Thread Heikki Linnakangas
On 04.03.2011 14:55, hom wrote: when I debug step in the scanner_init(), Eclipse always finds scan.l and the excute order is still unmatched. May it be scan.c actually ? Well, scan.c is generated with flex from scan.l. I don't know if Eclipse can handle that correctly. -- Heikki

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Yeb Havinga
On 2011-03-04 12:24, Yeb Havinga wrote: I'm currently thinking about a failure test that would check if a commit has really waited for the standby. What's the worst thing to do to a master server? Ideas are welcome :-) #!/bin/sh psql -c create a big table with generate_series echo 1

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Fujii Masao
On Fri, Mar 4, 2011 at 7:51 PM, Simon Riggs si...@2ndquadrant.com wrote: +             if (walsnd-pid != 0 +                     walsnd-sync_standby_priority 0 +                     (priority == 0 || +                      priority walsnd-sync_standby_priority)) +             { +        

Re: [HACKERS] pg_basebackup and wal streaming

2011-03-04 Thread Yeb Havinga
On 2011-02-18 11:02, Magnus Hagander wrote: Better late than never (or?), here's the final cleanup of pg_streamrecv for moving into the main distribution, per discussion back in late dec or early jan. It also includes the stream logs in parallel to backup part that was not completed on

Re: [HACKERS] pg_basebackup and wal streaming

2011-03-04 Thread Magnus Hagander
On Fri, Mar 4, 2011 at 15:23, Yeb Havinga yebhavi...@gmail.com wrote: On 2011-02-18 11:02, Magnus Hagander wrote: Better late than never (or?), here's the final cleanup of pg_streamrecv for moving into the main distribution, per discussion back in late dec or early jan. It also includes the

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 8:08 AM, Marios Vodas mvo...@gmail.com wrote: C doesn't break on free(NULL) so why is pfree developed to break on NULL? Is there any way in PostgreSQL to overcome this so that it won't break, apart from checking if the pointer NULL? I think that free(NULL) works on some

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Peter Geoghegan
On 4 March 2011 14:50, Robert Haas robertmh...@gmail.com wrote: I think that free(NULL) works on some platforms but not all.  I don't see what advantage we'd get out of making pfree(NULL) silently work, and there's a clear disadvantage: it would remove a useful sanity check. I don't feel

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Simon Riggs
On Fri, 2011-03-04 at 23:15 +0900, Fujii Masao wrote: postgres=# SELECT application_name, state, sync_priority, sync_state FROM pg_stat_replication; application_name | state | sync_priority | sync_state --+---+---+ one |

Re: [HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Tom Lane
Peter Geoghegan peter.geoghega...@gmail.com writes: On 4 March 2011 14:50, Robert Haas robertmh...@gmail.com wrote: I think that free(NULL) works on some platforms but not all.  I don't see what advantage we'd get out of making pfree(NULL) silently work, and there's a clear disadvantage: it

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: In the simplest form we could implement this by just removing the superuser() check in CREATE EXTENSION. But then people who tried to load a superuser-only extension would get a permissions failure on some

Re: [HACKERS] ALTER TABLE deadlock with concurrent INSERT

2011-03-04 Thread Joe Conway
On 03/03/2011 11:36 PM, Noah Misch wrote: Does relation 16902 (attribute_summary) have a foreign key constraint over the sequence_number column, in either direction, with relation 16896? That would explain it: session 1: ALTER TABLE attribute_summary ... sleeps after relation_openrv in

Re: [HACKERS] Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum

2011-03-04 Thread Heikki Linnakangas
On 04.03.2011 11:00, daveg wrote: Thanks, I've applied both patches to one host. I'll probably have to back down on the debugging logging soon, as the output is pretty voluminious, it is producing 100MB of message log every few minutes. I'll try Merlins patch to get the case setting the bit

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 10:43 AM, Tom Lane t...@sss.pgh.pa.us wrote: Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: In the simplest form we could implement this by just removing the superuser() check in CREATE EXTENSION.  But then people who tried to load a

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Mar 4, 2011 at 10:43 AM, Tom Lane t...@sss.pgh.pa.us wrote: I've thought of two other issues that need some discussion before we can get very far with this: 1. What should pg_dump do with the preinstalled extension plpgsql? We could put in a

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Peter Eisentraut
On ons, 2011-03-02 at 13:15 -0800, David E. Wheeler wrote: If not, how should one require a PL? Come to think of it, how might I require other features that might not be included in a particular build, like xpath()? Probably not within the extension mechanism. An RPM package cannot, for

Re: [HACKERS] Open unmatch source file when step into parse_analyze() in Eclipse?

2011-03-04 Thread hom
I think Eclipse just find incorrect file. when Eclipse compiles the code, it should use scan.c to build. But when debugging, Eclipse open scan.l to step in. I don't known how to trace into scan.c :( 2011/3/4 Heikki Linnakangas heikki.linnakan...@enterprisedb.com: On 04.03.2011 14:55, hom

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 11:19 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Mar 4, 2011 at 10:43 AM, Tom Lane t...@sss.pgh.pa.us wrote: I've thought of two other issues that need some discussion before we can get very far with this: 1. What should

Re: [HACKERS] Open unmatch source file when step into parse_analyze() in Eclipse?

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 11:40 AM, hom obsidian...@gmail.com wrote: I think Eclipse just find incorrect file. when Eclipse compiles the code, it should use scan.c to build. But when debugging, Eclipse open scan.l to step in. That's a feature, not a bug. -- Robert Haas EnterpriseDB:

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread David E. Wheeler
On Mar 4, 2011, at 7:43 AM, Tom Lane wrote: Well it's easy to read that the other way round. Is superuser = true means that I need to be a superuser or does it mean that the script will get run as superuser no matter what? Not a huge problem, but still. What about using the PL terminology

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread David E. Wheeler
On Mar 4, 2011, at 8:19 AM, Tom Lane wrote: Hmm. Personally I do use createdb/dropdb but never createlang/droplang; but I'm well aware that my usage may not be typical. I'm a bit hesitant to just go and drop these without any warning. I could see deprecating them for a release or two and

Re: [HACKERS] Open unmatch source file when step into parse_analyze() in Eclipse?

2011-03-04 Thread hom
but if Eclipse steps in scan.I, the excute order does not match the source code. what should I do if I want to debug functions defined in scan.I ? 2011/3/5 Robert Haas robertmh...@gmail.com: On Fri, Mar 4, 2011 at 11:40 AM, hom obsidian...@gmail.com wrote: I think Eclipse just find incorrect

Re: [HACKERS] Perl 5.12 complains about ecpg parser-hacking scripts

2011-03-04 Thread Andy Colson
On 3/3/2011 6:49 AM, Michael Meskes wrote: On Wed, Mar 02, 2011 at 01:33:35PM -0600, Andy Colson wrote: I thought Kris was going to work on this, but saw no progress, and I was bored the other day, so I started working on it. Here is a parse.pl, with some major refactoring. I named it with a

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Mar 4, 2011, at 8:19 AM, Tom Lane wrote: Hmm. Personally I do use createdb/dropdb but never createlang/droplang; but I'm well aware that my usage may not be typical. I'm a bit hesitant to just go and drop these without any warning. I could

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: Hmm. I see your point, but trusted seems like it could just as easily be misunderstood. Anybody have any other opinions about the color of that bikeshed? Well it's just that it exists with a comparable meaning elsewhere. I will be working on this today.

Re: [HACKERS] why is max standby delay only 35 minutes?

2011-03-04 Thread Robert Treat
On Fri, Mar 4, 2011 at 2:03 AM, Magnus Hagander mag...@hagander.net wrote: On Fri, Mar 4, 2011 at 04:00, Robert Treat r...@xzilla.net wrote: I have a server where I wanted to do some reporting on a standby, and wanted to set the max standby delay to 1 hour. upon doing that, i get this in the

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Mar 4, 2011, at 7:43 AM, Tom Lane wrote: Dimitri Fontaine dimi...@2ndquadrant.fr wrote: What about using the PL terminology here, and calling the property 'trusted' (default false, so you have to be a superuser to load them)? Hmm. I see your

Re: [HACKERS] file signature for files that make up postgres database

2011-03-04 Thread Alvaro Herrera
Excerpts from Lee Duynslager's message of jue mar 03 19:23:35 -0300 2011: Hi I am trying to recover a postgres database from a ext3 partition that the filesystem has become corrupt and lost files. Can anybody tell me what are the file signatures for the files that comprise a postgres

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: requires_superuser isn't bad, but I think I'd rather avoid requires here since we're also using that terminology for prerequisite extensions. How about must_be_superuser? Sorry to continue painting in old fashioned colors, but if we're not going to reuse

Re: [HACKERS] Quick Extensions Question

2011-03-04 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: requires_superuser isn't bad, but I think I'd rather avoid requires here since we're also using that terminology for prerequisite extensions. How about must_be_superuser? Sorry to continue painting in old

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Fujii Masao
On Fri, Mar 4, 2011 at 7:21 PM, Simon Riggs si...@2ndquadrant.com wrote: SIGTERM can be sent by pg_terminate_backend(). So we should check whether shutdown is requested before emitting WARNING and closing the connection. If it's not requested yet, I think that it's safe to return the success

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 3:04 PM, Fujii Masao masao.fu...@gmail.com wrote: The wait-forever might be a straightforward approach against (B). But this option prevents transactions from running not only when the synchronous standby goes away, but also when the primary is invoked first or when the

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Jaime Casanova
On Thu, Mar 3, 2011 at 1:23 PM, Robert Haas robertmh...@gmail.com wrote: The patch sets * as the default, so all standbys are synchronous by default. Would you prefer it if it was blank, meaning no standbys are synchronous, by default? I think * is a reasonable default. Actually i would

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 4:18 PM, Jaime Casanova ja...@2ndquadrant.com wrote: On Thu, Mar 3, 2011 at 1:23 PM, Robert Haas robertmh...@gmail.com wrote: The patch sets * as the default, so all standbys are synchronous by default. Would you prefer it if it was blank, meaning no standbys are

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Yeb Havinga
On 2011-03-04 22:18, Jaime Casanova wrote: On Thu, Mar 3, 2011 at 1:23 PM, Robert Haasrobertmh...@gmail.com wrote: The patch sets * as the default, so all standbys are synchronous by default. Would you prefer it if it was blank, meaning no standbys are synchronous, by default? I think * is a

Re: wrapping up this CommitFest (was Re: [HACKERS] knngist - 0.8)

2011-03-04 Thread Simon Riggs
On Tue, 2011-03-01 at 22:56 +, Simon Riggs wrote: On Tue, 2011-03-01 at 12:42 -0800, Josh Berkus wrote: That response is just dodging the hard question, so whatever. Tom's cleanup is not going to break things, or at least it's going to fix more than it breaks on net. Sync rep, on

[HACKERS] Extensions vs. shared procedural language handler functions

2011-03-04 Thread Tom Lane
So while hacking away at the PLs-as-extension changes I ran across an unforeseen complication. plperl and plpython use the same C function entry points for both their trusted and untrusted variants. This is problematic for making them into extensions, since we need the two language variants to

Re: [HACKERS] Extensions vs. shared procedural language handler functions

2011-03-04 Thread Jan Urbański
On 05/03/11 01:58, Tom Lane wrote: So while hacking away at the PLs-as-extension changes I ran across an unforeseen complication. plperl and plpython use the same C function entry points for both their trusted and untrusted variants. This is problematic for making them into extensions, since

Re: [HACKERS] Extensions vs. shared procedural language handler functions

2011-03-04 Thread Tom Lane
=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= wulc...@wulczer.org writes: ITYM plperl only, because plpython does not have a trusted variant. But there might be another obstacle here: plpython comes in two variants: plpython2u and plpython3u, and which one is built depends on the compile time

Re: [HACKERS] Alpha4 release blockers (was Re: wrapping up this CommitFest)

2011-03-04 Thread Robert Haas
Let's review where we are. On Tue, Mar 1, 2011 at 3:35 PM, Tom Lane t...@sss.pgh.pa.us wrote: * Regression test failures from recent plpython patches.  These are affecting enough machines to make them must fix before alpha, IMO. There are some variations in error message wording, which are not

Re: [HACKERS] Alpha4 release blockers (was Re: wrapping up this CommitFest)

2011-03-04 Thread Robert Haas
On Fri, Mar 4, 2011 at 10:44 PM, Robert Haas robertmh...@gmail.com wrote: So it seems like the only thing that is an absolute must-do is write some release notes. Here's a rough attempt at filtering the post-alpha3 commit log down to approximately the set of things worth adding to the alpha4

Re: [HACKERS] Alpha4 release blockers (was Re: wrapping up this CommitFest)

2011-03-04 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: So it seems like the only thing that is an absolute must-do is write some release notes. The buildfarm is showing that I broke MSVC builds, but other than that, yeah. What needs to happen for MSVC is that the rules for installing DATA files need to be

Re: [HACKERS] Sync Rep v19

2011-03-04 Thread Fujii Masao
On Sat, Mar 5, 2011 at 7:28 AM, Simon Riggs si...@2ndquadrant.com wrote: Almost-working patch attached for the above feature. Time to stop for the day. Patch against current repo version. Current repo version attached here also (v20), which includes all fixes to all known technical issues,