Re: [HACKERS] WIP checksums patch

2012-10-09 Thread Amit Kapila
On Monday, October 01, 2012 11:11 PM Jeff Davis wrote: On Mon, 2012-10-01 at 18:14 +0100, Simon Riggs wrote: You are missing large parts of the previous thread, giving various opinions on what the UI should look like for enabling checksums. I read through all of the discussion that I could

Re: [HACKERS] Bad Data back Door

2012-10-09 Thread Albe Laurenz
David E. Wheeler wrote: As the author I agree that this is a bug in oracle_fdw. Thanks. Should I file a report somewhere? That's not necessary. Thanks for reporting the problem. It may be a few days until I get around to fix that. Oracle does not care much about correct encoding. Yeah,

Re: [HACKERS] sortsupport for text

2012-10-09 Thread Dimitri Fontaine
Peter Geoghegan pe...@2ndquadrant.com writes: On 8 October 2012 21:35, Robert Haas robertmh...@gmail.com wrote: Gentlemen, you can't fight here. This is the War Room. Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via

Re: [HACKERS] Deparsing DDL command strings

2012-10-09 Thread Dimitri Fontaine
Jim Nasby j...@nasby.net writes: I definitely want to be able to parse DDL commands to be able to either enforce things or to drive other parts of the system based on what's changing. Without the ability to capture (and parse) DDL commands I'm stuck creating wrapper functions around anything I

[HACKERS] Truncate if exists

2012-10-09 Thread Sébastien Lardière
Hi, With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the presence in the list of tables of a missing or invisible table. This meets the needs of scripts that should be run in different stages, and do not always have the same

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Simon Riggs
On 9 October 2012 09:33, Sébastien Lardière slardi...@hi-media.com wrote: With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the presence in the list of tables of a missing or invisible table. This meets the needs of scripts that

Re: [HACKERS] Bugs in CREATE/DROP INDEX CONCURRENTLY

2012-10-09 Thread Simon Riggs
On 6 October 2012 00:56, Tom Lane t...@sss.pgh.pa.us wrote: 1. These operations think they can use ordinary heap_update operations to change pg_index entries when they don't have exclusive lock on the parent table. The lack of ex-lock means that another backend could be currently loading up

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Sébastien Lardière
On 10/09/2012 11:09 AM, Simon Riggs wrote: On 9 October 2012 09:33, Sébastien Lardière slardi...@hi-media.com wrote: With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the presence in the list of tables of a missing or invisible

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Vik Reykja
On Tue, Oct 9, 2012 at 11:09 AM, Simon Riggs si...@2ndquadrant.com wrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? Yes, DEALLOCATE.

Re: [HACKERS] Detecting libpq connections improperly shared via fork()

2012-10-09 Thread Andres Freund
On Thursday, October 04, 2012 03:23:54 AM Tom Lane wrote: Daniel Farina dan...@heroku.com writes: On Wed, Oct 3, 2012 at 3:14 PM, Andres Freund and...@2ndquadrant.com wrote: Hm. An easier version of this could just be storing the pid of the process that did the PQconnectdb* in the PGconn

Re: [HACKERS] Detecting libpq connections improperly shared via fork()

2012-10-09 Thread Daniel Farina
On Tue, Oct 9, 2012 at 2:51 AM, Andres Freund and...@2ndquadrant.com wrote: On Thursday, October 04, 2012 03:23:54 AM Tom Lane wrote: Daniel Farina dan...@heroku.com writes: On Wed, Oct 3, 2012 at 3:14 PM, Andres Freund and...@2ndquadrant.com wrote: Hm. An easier version of this could just

Re: [HACKERS] Move postgresql_fdw_validator into dblink

2012-10-09 Thread Kohei KaiGai
Hanada-san, It is fair enough for me. So, I'd like to hand over this patch for committers. Thanks, 2012/10/9 Shigeru HANADA shigeru.han...@gmail.com: (2012/10/09 0:30), Kohei KaiGai wrote: The attached patch is a revised one according to my previous suggestion. It re-defines

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Vik Reykja
On Tue, Oct 9, 2012 at 11:51 AM, Vik Reykja vikrey...@gmail.com wrote: On Tue, Oct 9, 2012 at 11:09 AM, Simon Riggs si...@2ndquadrant.comwrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? Yes, DEALLOCATE. Patch attached. deallocate_if_exists.patch

Re: [HACKERS] [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown

2012-10-09 Thread Robert Haas
On Mon, Oct 8, 2012 at 10:42 AM, Amit Kapila amit.kap...@huawei.com wrote: How about following: 1. replication_client_timeout -- shouldn't it be client as new configuration is for wal receiver 2. replication_standby_timeout ISTM that the client and the standby are the same thing. If we

Re: [HACKERS] Bad Data back Door

2012-10-09 Thread Albe Laurenz
I wrote: Tom Lane wrote: Now, having said that, I think it has to be the reponsibility of the FDW to apply any required check ... which makes this a bug report against oracle_fdw, not the core system. As the author I agree that this is a bug in oracle_fdw. Ok, fixed. David, could you try

Re: [HACKERS] [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown

2012-10-09 Thread Amit Kapila
On Tuesday, October 09, 2012 6:00 PM Robert Haas wrote: On Mon, Oct 8, 2012 at 10:42 AM, Amit Kapila amit.kap...@huawei.com wrote: How about following: 1. replication_client_timeout -- shouldn't it be client as new configuration is for wal receiver 2. replication_standby_timeout ISTM

[HACKERS] Behavior for crash recovery when it detects a corrupt WAL record

2012-10-09 Thread Amit Kapila
I have observed that currently during recovery, while it applies the WAL records even if it detects that there is a corrupt record by crc validation, it proceeds. Basically ReadRecord(), returns NULL in such cases which makes the behavior same as it has reached end of WAL. After that server

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On 9 October 2012 09:33, Sébastien Lardière slardi...@hi-media.com wrote: With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the presence in the list of tables of a missing or invisible

Re: [HACKERS] Behavior for crash recovery when it detects a corrupt WAL record

2012-10-09 Thread Heikki Linnakangas
On 09.10.2012 16:42, Amit Kapila wrote: I have observed that currently during recovery, while it applies the WAL records even if it detects that there is a corrupt record by crc validation, it proceeds. Basically ReadRecord(), returns NULL in such cases which makes the behavior same as it has

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Tom Lane
=?ISO-8859-1?Q?S=E9bastien_Lardi=E8re?= slardi...@hi-media.com writes: Indeed, brackets was not correct, it's better now (I think), and correct some comments. Still wrong ... at the very least you missed copyfuncs/equalfuncs. In general, when adding a field to a struct, it's good practice to

Re: [HACKERS] Add FET to Default and Europe.txt

2012-10-09 Thread Greg Stark
On Mon, Oct 8, 2012 at 4:26 PM, Tom Lane t...@sss.pgh.pa.us wrote: for instance IST (the Indians and the Israelis both use this, but not to mean the same thing). And Ireland btw. So I'm not sure if this goes anywhere but could we get away with picking the timezone with the matching

Re: [HACKERS] TODO item: teach pg_dump about sparsely-stored large objects

2012-10-09 Thread Greg Stark
On Tue, Oct 9, 2012 at 3:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Admittedly, this is no different than what happens when you try to back up a sparsely-stored Unix file, at least with simpler backup tools. But it seems to me we should try a bit harder. Fwiw both GNU tar and GNU cp support

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Sébastien Lardière
On 10/09/2012 04:06 PM, Tom Lane wrote: Simon Riggs si...@2ndquadrant.com writes: On 9 October 2012 09:33, Sébastien Lardière slardi...@hi-media.com wrote: With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the presence in the list

Re: [HACKERS] Switching timeline over streaming replication

2012-10-09 Thread Heikki Linnakangas
On 06.10.2012 15:58, Amit Kapila wrote: One more test seems to be failed. Apart from this, other tests are passed. 2. a. Master M-1 b. Standby S-1 follows M-1 c. insert 10 records on M-1. verify all records are visible on M-1,S-1 d. Stop S-1 e. insert 2 records on M-1. f.

Re: [HACKERS] Detecting libpq connections improperly shared via fork()

2012-10-09 Thread Martijn van Oosterhout
On Thu, Oct 04, 2012 at 12:14:02AM +0200, Andres Freund wrote: On Thursday, October 04, 2012 12:08:18 AM Daniel Farina wrote: It would be fantastic for libpq to somehow monitor use of a connection from multiple PIDs that share a parent and deliver an error indicating what is wrong.

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Robert Haas
On Tue, Oct 9, 2012 at 12:28 PM, Sébastien Lardière slardi...@hi-media.com wrote: For starters, the use-case hasn't been explained to my satisfaction. In what situation is it actually helpful to TRUNCATE a table that's not there yet? Aren't you going to have to do a CREATE IF NOT EXISTS to

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Simon Riggs
On 9 October 2012 15:06, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: On 9 October 2012 09:33, Sébastien Lardière slardi...@hi-media.com wrote: With the help of Cédric, here's a patch changing the TRUNCATE TABLE command, adding the IF EXISTS option to allow the

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Josh Berkus
Robert, I've been a big proponent of adding IF EXISTS support to CREATE TABLE and ALTER TABLE but I'm having a hard time getting excited about this one. I can't imagine that many people would use it, and those who do can implement it in about 10 lines of PL/pgsql. The existence of DO

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Peter Eisentraut
On 10/9/12 5:09 AM, Simon Riggs wrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? TRUNCATE is not really DDL. If we allow TRUNCATE IF EXISTS, what is stopping someone from requesting DELETE IF EXISTS or INSERT IF EXISTS next? -- Sent via pgsql-hackers

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Gavin Flower
On 10/10/12 09:35, Peter Eisentraut wrote: On 10/9/12 5:09 AM, Simon Riggs wrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? TRUNCATE is not really DDL. If we allow TRUNCATE IF EXISTS, what is stopping someone from requesting DELETE IF EXISTS or INSERT IF

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Simon Riggs
On 9 October 2012 21:35, Peter Eisentraut pete...@gmx.net wrote: On 10/9/12 5:09 AM, Simon Riggs wrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? TRUNCATE is not really DDL. If we allow TRUNCATE IF EXISTS, what is stopping someone from requesting DELETE IF

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Daniel Farina
On Tue, Oct 9, 2012 at 2:04 PM, Simon Riggs si...@2ndquadrant.com wrote: On 9 October 2012 21:35, Peter Eisentraut pete...@gmx.net wrote: On 10/9/12 5:09 AM, Simon Riggs wrote: Anyone want to check for any other missing IF EXISTS capability in other DDL? TRUNCATE is not really DDL. If we

Re: [HACKERS] [GENERAL] pgxs problem...

2012-10-09 Thread Tom Lane
John R Pierce pie...@hogranch.com writes: Further, it appears the link command pljava is using for the AIX case is given in its makefile as... $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(plugin) $ -Wl,-bE:$(NAME)$(EXPSUFF) $(SHLIB_LINK) I can't find anywhere LDFLAGS_NO_L is

[HACKERS] replace plugins directory with GUC

2012-10-09 Thread Peter Eisentraut
About that plugins directory ($libdir/plugins) ... I don't think we ever really got that to work sensibly. I don't remember the original design discussion, but I have seen a number of explanations offered over the years. It's not clear who decides what to put in there (plugin author, packager,

Re: [HACKERS] [GENERAL] pgxs problem...

2012-10-09 Thread Tom Lane
I wrote: So if I've not lost track, the scorecard is: 1. We need to install mkldexport.sh when on AIX, so that pgxs builds can use it. 2. Makefile.aix has the wrong idea about where to find postgres.imp when in pgxs mode. 3. pljava needs -lm and isn't explicitly asking for it. I will

Re: [HACKERS] Truncate if exists

2012-10-09 Thread Robert Haas
On Tue, Oct 9, 2012 at 4:18 PM, Josh Berkus j...@agliodbs.com wrote: The second is for making deployment scripts idempotent. For example, say you have script A which creates table josh, and script B which needs table josh to be empty, if present. Since the two scripts are tied to different