Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On Thu, Oct 4, 2012 at 11:51 AM, Tom Lane wrote: > Greg Stark writes: > > I'm a bit puzzled why we're so afraid of swapping the relfilenodes > > when that's what the current REINDEX does. > > Swapping the relfilenodes is fine *as long as you have exclusive lock*. > The trick is to make it safe w

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby [Review]

2012-10-03 Thread Boszormenyi Zoltan
2012-10-04 05:24 keltezéssel, Peter Eisentraut írta: On Wed, 2012-10-03 at 18:15 +0200, Boszormenyi Zoltan wrote: The second generation of this work is now attached and contains a new feature as was discussed and suggested by Magnus Hagander, Fujii Masao and Peter Eisentraut. So libpq has grown

Re: [HACKERS] xmalloc => pg_malloc

2012-10-03 Thread Tom Lane
Peter Eisentraut writes: > xmalloc, xstrdup, etc. are pretty common names for functions that do > alloc-or-die (another possible naming scheme ;-) ). The naming > pg_malloc etc. on the other hand suggests that the allocation is being > done in a PostgreSQL-specific way, and anyway sounds too clos

Re: [HACKERS] xmalloc => pg_malloc

2012-10-03 Thread Peter Eisentraut
On Tue, 2012-10-02 at 12:02 -0400, Tom Lane wrote: > While looking around to fix the pg_malloc(0) issue, I noticed that > various other pieces of code such as pg_basebackup have essentially > identical functions, except they're called xmalloc(). I propose to > standardize all these things on this

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby [Review]

2012-10-03 Thread Peter Eisentraut
On Wed, 2012-10-03 at 18:15 +0200, Boszormenyi Zoltan wrote: > The second generation of this work is now attached and contains a new > feature as was discussed and suggested by Magnus Hagander, Fujii Masao > and Peter Eisentraut. So libpq has grown a new function: > > +/* return the connection opt

Re: [HACKERS] Question on "box @> point" using GiST index on boxes

2012-10-03 Thread Tom Lane
Ralf Rantzau writes: > I would like to test the containment of a point against many boxes. > I did not find a way to express "box @> point" in straightforward way such > that the GiST index on the boxes is exploited. Yeah, that operator is not in any GiST opclass, as you can easily verify with a

[HACKERS] Docs bug: SET ROLE docs should "see also: DISCARD ALL"

2012-10-03 Thread Craig Ringer
Hi folks There's no mention anywhere in `SET ROLE` of the ability of `DISCARD ALL` to reset the role to default. Ditto `SET SESSION AUTHORIZATION`. That's pretty important, since an app that wants to allow arbitrary SQL to be executed as an assumed user identity might be guarding against "RE

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Tom Lane
Greg Stark writes: > I'm a bit puzzled why we're so afraid of swapping the relfilenodes > when that's what the current REINDEX does. Swapping the relfilenodes is fine *as long as you have exclusive lock*. The trick is to make it safe without that. It will definitely not work to do that without e

[HACKERS] Make CREATE AGGREGATE check validity of initcond value?

2012-10-03 Thread Tom Lane
In http://archives.postgresql.org/pgsql-general/2012-10/msg00138.php we see an example where a user tried to create an aggregate whose "initcond" (initial transition value) wasn't valid for the transition data type. CREATE AGGREGATE didn't complain because it just stores the initial condition as a

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Greg Stark
On Thu, Oct 4, 2012 at 2:19 AM, Michael Paquier wrote: >> I think what you'd have to do is drop the old index (relying on the >> assumption that no one is accessing it anymore after a certain point, so >> you can take exclusive lock on it now) and then rename the new index >> to have the old index

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

2012-10-03 Thread Andrew Dunstan
On 10/03/2012 09:23 PM, Tom Lane wrote: A bigger problem with this is that it only fixes the issue for cases in which somebody makes new threads of control with fork(). I believe that issues involving multiple threads trying to use the same PGconn are at least as widespread. I'm not terribly

Re: [HACKERS] FDW for PostgreSQL

2012-10-03 Thread Merlin Moncure
On Fri, Sep 14, 2012 at 9:25 AM, Shigeru HANADA wrote: > Hi all, > > I'd like to propose FDW for PostgreSQL as a contrib module again. > Attached patch is updated version of the patch proposed in 9.2 > development cycle. very nice. > - binary transfer (only against servers with same PG major v

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

2012-10-03 Thread Tom Lane
Andres Freund writes: > On Thursday, October 04, 2012 12:16:14 AM Daniel Farina wrote: >> I suppose this might needlessly eliminate someone who forks and hands >> off the PGconn struct to exactly one child, but it's hard to argue >> with its simplicity and portability of mechanism. > Even that sc

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On 2012/10/04, at 10:00, Tom Lane wrote: > Michael Paquier writes: >> On Wed, Oct 3, 2012 at 5:10 PM, Andres Freund wrote: >> 14) Swap new and old indexes, consisting here in switching their names. >>> I think switching based on their names is not going to work very well >>> because >>> indexes

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

2012-10-03 Thread Tom Lane
Daniel Farina writes: > On Wed, Oct 3, 2012 at 3:14 PM, Andres Freund wrote: >> Hm. An easier version of this could just be storing the pid of the process >> that did the PQconnectdb* in the PGconn struct. You can then check that >> PGconn->pid == getpid() at relatively few places and error out o

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Tom Lane
Phil Sorber writes: > How about adding it as an option to psql? That's not to say that I > think we shouldn't also add it to 'pg_ctl status'. > I was looking at the code and originally I was using return code to > signify what the status was and some text output when quiet wasn't > set, but psql

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Tom Lane
Michael Paquier writes: > On Wed, Oct 3, 2012 at 5:10 PM, Andres Freund wrote: > 14) Swap new and old indexes, consisting here in switching their names. >> I think switching based on their names is not going to work very well >> because >> indexes are referenced by oid at several places. Swapping

[HACKERS] bison location reporting for potentially-empty list productions

2012-10-03 Thread Tom Lane
In the just-committed patch for CREATE SCHEMA IF NOT EXISTS, there is an error thrown by the grammar when IF NOT EXISTS is specified together with any schema-element clauses. I thought it would make more sense for the error cursor to point at the schema-element clauses, rather than at the IF NOT E

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread David E. Wheeler
On Oct 3, 2012, at 4:49 PM, Tom Lane wrote: > Committed with some adjustments, notably repairing the > order-of-operations error I complained about before. Awesome, thanks! David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Tom Lane
=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= writes: > The attached patch implements the behavior we've discussed. Committed with some adjustments, notably repairing the order-of-operations error I complained about before. regards, tom lane -- Sent via pgsql-hackers mail

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On Wed, Oct 3, 2012 at 5:10 PM, Andres Freund wrote: > > 14) Swap new and old indexes, consisting here in switching their names. > I think switching based on their names is not going to work very well > because > indexes are referenced by oid at several places. Swapping > pg_index.indexrelid > or

[HACKERS] Question on "box @> point" using GiST index on boxes

2012-10-03 Thread Ralf Rantzau
Hello, I would like to test the containment of a point against many boxes. I did not find a way to express "box @> point" in straightforward way such that the GiST index on the boxes is exploited. The only way to use a point directly is to turn the box into a polygon. Is it a missing feature? T

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Tom Lane
Martijn van Oosterhout writes: > On Wed, Oct 03, 2012 at 01:57:47PM -0400, Bruce Momjian wrote: >> On Wed, Oct 3, 2012 at 01:53:28PM -0400, Tom Lane wrote: >>> How exactly would a library prevent such problems? In particular, >>> let's see a proposal for how libpq might make it look like a fork

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

2012-10-03 Thread Daniel Farina
On Wed, Oct 3, 2012 at 3:34 PM, Andres Freund wrote: > On Thursday, October 04, 2012 12:16:14 AM Daniel Farina wrote: >> On Wed, Oct 3, 2012 at 3:14 PM, Andres Freund > wrote: >> > On Thursday, October 04, 2012 12:08:18 AM Daniel Farina wrote: >> >> It would be fantastic for libpq to somehow moni

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

2012-10-03 Thread Andres Freund
On Thursday, October 04, 2012 12:16:14 AM Daniel Farina wrote: > On Wed, Oct 3, 2012 at 3:14 PM, 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

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

2012-10-03 Thread Daniel Farina
On Wed, Oct 3, 2012 at 3:14 PM, 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. Unfortunately

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

2012-10-03 Thread Andres Freund
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. Unfortunately detecting that would require either a > file or some kind

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Phil Sorber
On Wed, Oct 3, 2012 at 11:42 AM, Pavel Stehule wrote: > 2012/10/3 Phil Sorber : >> On Wed, Oct 3, 2012 at 11:35 AM, Bruce Momjian wrote: >>> On Tue, Oct 2, 2012 at 11:01:36PM -0400, Phil Sorber wrote: I was wondering recently if there was any command line tool that utilized PQping() or

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

2012-10-03 Thread Daniel Farina
Per http://archives.postgresql.org/pgsql-hackers/2012-10/msg00167.php On Wed, Oct 3, 2012 at 9:41 AM, Tom Lane wrote: > To bring that closer to home, suppose you have a program with an open > database connection in libpq, and you fork(), and then parent and child > both try to use the connection.

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
On Wednesday, October 03, 2012 11:42:25 PM Michael Paquier wrote: > On 2012/10/04, at 5:41, Andres Freund wrote: > > On Wednesday, October 03, 2012 10:12:58 PM Michael Paquier wrote: > >> On 2012/10/03, at 23:52, Andres Freund wrote: > >>> On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Martijn van Oosterhout
On Wed, Oct 03, 2012 at 01:57:47PM -0400, Bruce Momjian wrote: > On Wed, Oct 3, 2012 at 01:53:28PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > Yes, but those framework libraries are typically supposed to prevent > > > such problems from being seen by applications calling them. > > > >

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On 2012/10/04, at 5:41, Andres Freund wrote: > On Wednesday, October 03, 2012 10:12:58 PM Michael Paquier wrote: >> On 2012/10/03, at 23:52, Andres Freund wrote: >>> On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote: Andres Freund writes: > Maybe I am missing something here, b

Re: [HACKERS] ALTER command reworks

2012-10-03 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of mié oct 03 18:25:54 -0300 2012: > Excerpts from Kohei KaiGai's message of lun sep 10 08:08:32 -0300 2012: > > > As attached, I split off the original one into three portions; for > > set-schema, > > set-owner and rename-to. Please apply them in order of p

Re: [HACKERS] ALTER command reworks

2012-10-03 Thread Alvaro Herrera
Excerpts from Kohei KaiGai's message of lun sep 10 08:08:32 -0300 2012: > As attached, I split off the original one into three portions; for set-schema, > set-owner and rename-to. Please apply them in order of patch filename. > Regarding to the error message, RenameErrorMsgAlreadyExists() was adde

Re: [HACKERS] FDW for PostgreSQL

2012-10-03 Thread Kohei KaiGai
Hanada-san, I tried to check this patch. Because we also had some discussion on this extension through the last two commit fests, I have no fundamental design arguments. So, let me drop in the implementation detail of this patch. At the postgresql_fdw/deparse.c, * Even though deparseVar() is ne

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
On Wednesday, October 03, 2012 10:12:58 PM Michael Paquier wrote: > On 2012/10/03, at 23:52, Andres Freund wrote: > > On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote: > >> Andres Freund writes: > >>> Maybe I am missing something here, but reindex concurrently should do > >>> 1) BEGIN >

Re: [HACKERS] pg_upgrade does not completely honor --new-port

2012-10-03 Thread Bruce Momjian
On Wed, Oct 3, 2012 at 05:16:55PM -0300, Alvaro Herrera wrote: > Excerpts from Devrim GÜNDÜZ's message of mié oct 03 17:00:16 -0300 2012: > > > > Hi, > > > > On Wed, 2012-09-26 at 22:06 -0400, Bruce Momjian wrote: > > > > > > I just performed a test upgrade from 9.1 to 9.2, and used > > > > --n

Re: [HACKERS] pg_upgrade does not completely honor --new-port

2012-10-03 Thread Bruce Momjian
On Wed, Oct 3, 2012 at 11:00:16PM +0300, Devrim Gunduz wrote: > > Hi, > > On Wed, 2012-09-26 at 22:06 -0400, Bruce Momjian wrote: > > > > I just performed a test upgrade from 9.1 to 9.2, and used > > > --new-port variable. However, the analyze_new_cluster.sh does not > > > include the new port,

Re: [HACKERS] pg_upgrade does not completely honor --new-port

2012-10-03 Thread Alvaro Herrera
Excerpts from Devrim GÜNDÜZ's message of mié oct 03 17:00:16 -0300 2012: > > Hi, > > On Wed, 2012-09-26 at 22:06 -0400, Bruce Momjian wrote: > > > > I just performed a test upgrade from 9.1 to 9.2, and used > > > --new-port variable. However, the analyze_new_cluster.sh does not > > > include the

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On 2012/10/03, at 23:52, Andres Freund wrote: > On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote: >> Andres Freund writes: >>> Maybe I am missing something here, but reindex concurrently should do >>> 1) BEGIN >>> 2) Lock table in share update exlusive >>> 3) lock old index >>> 3) crea

Re: [HACKERS] pg_upgrade does not completely honor --new-port

2012-10-03 Thread Devrim GÜNDÜZ
Hi, On Wed, 2012-09-26 at 22:06 -0400, Bruce Momjian wrote: > > I just performed a test upgrade from 9.1 to 9.2, and used > > --new-port variable. However, the analyze_new_cluster.sh does not > > include the new port, thus when I run it, it fails. Any chance to > > add the port number to the sc

Re: [HACKERS] Hash id in pg_stat_statements

2012-10-03 Thread Daniel Farina
On Wed, Oct 3, 2012 at 11:04 AM, Tom Lane wrote: > Daniel Farina writes: >> Instead, I think it makes sense to assign a number -- arbitrarily, but >> uniquely -- to the generation of a new row in pg_stat_statements, and, >> on the flip side, whenever a row is retired its number should be >> elimi

Re: [HACKERS] gistchoose vs. bloat

2012-10-03 Thread Alexander Korotkov
On Mon, Oct 1, 2012 at 5:15 AM, Jeff Davis wrote: > On Tue, 2012-09-04 at 19:21 +0400, Alexander Korotkov wrote: > > > New version of patch is attached. Parameter "randomization" was > > introduced. It controls whether to randomize choose. Choose algorithm > > was rewritten. > > > Review comments

Re: [HACKERS] Hash id in pg_stat_statements

2012-10-03 Thread Peter Geoghegan
On 3 October 2012 19:04, Tom Lane wrote: > Daniel Farina writes: >> Instead, I think it makes sense to assign a number -- arbitrarily, but >> uniquely -- to the generation of a new row in pg_stat_statements, and, >> on the flip side, whenever a row is retired its number should be >> eliminated, p

Re: [HACKERS] Hash id in pg_stat_statements

2012-10-03 Thread Tom Lane
Daniel Farina writes: > Instead, I think it makes sense to assign a number -- arbitrarily, but > uniquely -- to the generation of a new row in pg_stat_statements, and, > on the flip side, whenever a row is retired its number should be > eliminated, practically, for-ever. This way re-introductions

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Bruce Momjian
On Wed, Oct 3, 2012 at 01:53:28PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > Yes, but those framework libraries are typically supposed to prevent > > such problems from being seen by applications calling them. > > How exactly would a library prevent such problems? In particular, > let's

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Tom Lane
=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= writes: > The attached patch implements the behavior we've discussed. OK, I'll pick this up again, since we seem to have consensus on this behavior. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postg

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Tom Lane
Bruce Momjian writes: > Yes, but those framework libraries are typically supposed to prevent > such problems from being seen by applications calling them. How exactly would a library prevent such problems? In particular, let's see a proposal for how libpq might make it look like a fork was trans

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Fabrízio de Royes Mello
2012/10/3 Alvaro Herrera > Excerpts from Fabrízio de Royes Mello's message of mié oct 03 10:11:03 > -0300 2012: > > > Maybe something like this? > > > >ereport(ERROR, > >(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > > errmsg("IF NOT EXISTS cannot be used with schema eleme

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Bruce Momjian
On Wed, Oct 3, 2012 at 12:41:37PM -0400, Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> Noticed while perusing > >> http://lwn.net/Articles/518306/ > > > I'm afraid Brian was just looking for an excuse to dump on Apple. We > > have a lot of years of Postgres experience showing that

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> Noticed while perusing >> http://lwn.net/Articles/518306/ > I'm afraid Brian was just looking for an excuse to dump on Apple. We > have a lot of years of Postgres experience showing that fork() works > fine on OS X. BTW, I think the commenter at the bottom o

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Tom Lane
Alvaro Herrera writes: > See the CAVEATS here: > https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/fork.2.html > Apparently fork() without exec() isn't all that well supported. This doesn't say fork() doesn't work. It says that Apple's framework libraries are

Re: [HACKERS] Tablefunc crosstab error messages

2012-10-03 Thread Noah Misch
On Mon, Aug 27, 2012 at 08:07:02PM -0400, Mali Akmanalp wrote: > Returning the type information to the caller seems like a pain > but compatCrosstabTupleDescs already has instances in it where it fails > with an error message, so I propose we just do that and tell the user the > expected and actual

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby [Review]

2012-10-03 Thread Boszormenyi Zoltan
Hi, first, thanks for the review. Comments are below. 2012-09-20 12:30 keltezéssel, Amit Kapila írta: On Sun, 01 Jul 2012 13:02:17 +0200 Boszormenyi Zoltan wrote: >attached is a patch that does $SUBJECT. >It's a usability enhancement, to take a backup, write >a minimalistic recovery.conf an

Re: [HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Bruce Momjian
On Wed, Oct 3, 2012 at 01:05:54PM -0300, Alvaro Herrera wrote: > See the CAVEATS here: > > https://developer.apple.com/library/mac/#documentation/Darwin/Referenc > e/ManPages/man2/fork.2.html > > Apparently fork() without exec() isn't all that well supported. > > Noticed while perusing http://lwn.n

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Alvaro Herrera
Excerpts from Fabrízio de Royes Mello's message of mié oct 03 10:11:03 -0300 2012: > Maybe something like this? > >ereport(ERROR, >(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("IF NOT EXISTS cannot be used with schema elements"), > parser_errposition(

[HACKERS] do we EXEC_BACKEND on Mac OS X?

2012-10-03 Thread Alvaro Herrera
See the CAVEATS here: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/fork.2.html Apparently fork() without exec() isn't all that well supported. Noticed while perusing http://lwn.net/Articles/518306/ -- Álvaro Herrerahttp://www.2ndQuadrant

Re: [HACKERS] Missing OID define

2012-10-03 Thread Thom Brown
On 2 October 2012 15:47, Phil Sorber wrote: > Thom Brown and I were doing some hacking the other day and came across > this missing define. We argued over who was going to send the patch in > and I lost. So here it is. Capital idea. +1 -- Thom -- Sent via pgsql-hackers mailing list (pgsql-ha

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Pavel Stehule
2012/10/3 Phil Sorber : > On Wed, Oct 3, 2012 at 11:35 AM, Bruce Momjian wrote: >> On Tue, Oct 2, 2012 at 11:01:36PM -0400, Phil Sorber wrote: >>> I was wondering recently if there was any command line tool that >>> utilized PQping() or PQpingParams(). I searched the code and couldn't >>> find an

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Tom Lane
Bruce Momjian writes: > I don't see any tool using PQping except pg_ctl. Perhaps we should > modify "pg_ctl status" to use PQping. Right now is only checks the > postmaster.pid file, and checks to see that the pid is a running > postmaster. What it currently doesn't do is to check if the server

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Phil Sorber
On Wed, Oct 3, 2012 at 11:35 AM, Bruce Momjian wrote: > On Tue, Oct 2, 2012 at 11:01:36PM -0400, Phil Sorber wrote: >> I was wondering recently if there was any command line tool that >> utilized PQping() or PQpingParams(). I searched the code and couldn't >> find anything and was wondering if th

Re: [HACKERS] PQping command line tool

2012-10-03 Thread Bruce Momjian
On Tue, Oct 2, 2012 at 11:01:36PM -0400, Phil Sorber wrote: > I was wondering recently if there was any command line tool that > utilized PQping() or PQpingParams(). I searched the code and couldn't > find anything and was wondering if there was any interest to have > something like this included?

Re: [HACKERS] Switching timeline over streaming replication

2012-10-03 Thread Amit Kapila
On Tuesday, October 02, 2012 4:21 PM Heikki Linnakangas wrote: > Thanks for the thorough review! I committed the xlog.c refactoring patch > now. Attached is a new version of the main patch, comments on specific > points below. I didn't adjust the docs per your comments yet, will do > that next. I

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote: > Andres Freund writes: > > Maybe I am missing something here, but reindex concurrently should do > > 1) BEGIN > > 2) Lock table in share update exlusive > > 3) lock old index > > 3) create new index > > 4) obtain session locks on table, o

Re: [HACKERS] [9.1] 2 bugs with extensions

2012-10-03 Thread Alvaro Herrera
Excerpts from Dimitri Fontaine's message of mié sep 26 11:36:38 -0300 2012: > Marko Kreen writes: > > 1) Dumpable sequences are not supported - if sequence is tagged > >with pg_catalog.pg_extension_config_dump(), the pg_dump tries > >to run COPY on it. > > I can only reproduce that in 9.

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Tom Lane
Andres Freund writes: > Maybe I am missing something here, but reindex concurrently should do > 1) BEGIN > 2) Lock table in share update exlusive > 3) lock old index > 3) create new index > 4) obtain session locks on table, old index, new index > 5) commit > 6) process till newindex->insisready (n

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Fabrízio de Royes Mello
2012/10/3 Alvaro Herrera > Excerpts from Fabrízio de Royes Mello's message of mié oct 03 09:27:41 > -0300 2012: > > 2012/10/2 Fabrízio de Royes Mello > > > > > > > > You're right... the latest proposed patch don't implements it. > > > > > > I'll change the patch and send soon... > > > > > > > >

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Alvaro Herrera
Excerpts from Fabrízio de Royes Mello's message of mié oct 03 09:27:41 -0300 2012: > 2012/10/2 Fabrízio de Royes Mello > > > > > You're right... the latest proposed patch don't implements it. > > > > I'll change the patch and send soon... > > > > > What is more reasonable? > * show a syntax erro

[HACKERS] Re: PATCH: pgbench - random sampling of transaction written into log

2012-10-03 Thread Heikki Linnakangas
On 03.09.2012 01:40, Tomas Vondra wrote: So, here is a fixed version of the patch. I've made these changes: Committed with some minor kibitzing. 1) The option is now '--sampling-rate' instead of '-R' and accepts float arguments. I've decided not to use 0.01 = 1% but use 1 = 1%, so it accepts

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby

2012-10-03 Thread Boszormenyi Zoltan
2012-07-01 18:01 keltezéssel, Fujii Masao írta: On Mon, Jul 2, 2012 at 12:42 AM, Boszormenyi Zoltan wrote: Hi, 2012-07-01 17:38 keltezéssel, Fujii Masao írta: On Sun, Jul 1, 2012 at 8:02 PM, Boszormenyi Zoltan wrote: Hi, attached is a patch that does $SUBJECT. It's a usability enhancemen

Re: [HACKERS] CREATE SCHEMA IF NOT EXISTS

2012-10-03 Thread Fabrízio de Royes Mello
2012/10/2 Fabrízio de Royes Mello > > You're right... the latest proposed patch don't implements it. > > I'll change the patch and send soon... > > What is more reasonable? * show a syntax error or * show a message that you can not use the INE with contained objects Regards, -- Fabrízio de Roy

[HACKERS] Re: ToDo: allow to get a number of processed rows by COPY statement [Review of Patch]

2012-10-03 Thread Heikki Linnakangas
On 02.10.2012 14:09, Pavel Stehule wrote: fixed patch Thanks, committed with some minor editorializing. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
On Wednesday, October 03, 2012 01:15:27 PM Michael Paquier wrote: > On Wed, Oct 3, 2012 at 8:08 PM, Andres Freund wrote: > > On Wednesday, October 03, 2012 12:59:25 PM Greg Stark wrote: > > > Just for background. The showstopper for REINDEX concurrently was not > > > that it was particularly hard t

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On Wed, Oct 3, 2012 at 8:08 PM, Andres Freund wrote: > On Wednesday, October 03, 2012 12:59:25 PM Greg Stark wrote: > > Just for background. The showstopper for REINDEX concurrently was not > > that it was particularly hard to actually do the reindexing. But it's > > not obvious how to obtain a lo

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
On Wednesday, October 03, 2012 12:59:25 PM Greg Stark wrote: > Just for background. The showstopper for REINDEX concurrently was not > that it was particularly hard to actually do the reindexing. But it's > not obvious how to obtain a lock on both the old and new index without > creating a deadlock

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Greg Stark
Just for background. The showstopper for REINDEX concurrently was not that it was particularly hard to actually do the reindexing. But it's not obvious how to obtain a lock on both the old and new index without creating a deadlock risk. I don't remember exactly where the deadlock risk lies but ther

Re: [HACKERS] [PATCH] lock_timeout and common SIGALRM framework

2012-10-03 Thread Boszormenyi Zoltan
Hi, this is the latest one, fixing a bug in the accounting of per-statement lock timeout handling and tweaking some comments. Best regards, Zoltán Böszörményi -- -- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austr

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby

2012-10-03 Thread Magnus Hagander
On Wed, Oct 3, 2012 at 10:37 AM, Boszormenyi Zoltan wrote: > Hi, > > 2012-10-03 10:25 keltezéssel, Magnus Hagander írta: >> >> On Tue, Jul 3, 2012 at 9:47 PM, Peter Eisentraut wrote: >>> >>> On mĺn, 2012-07-02 at 01:10 +0900, Fujii Masao wrote: > > But I think that part is lacking in func

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby

2012-10-03 Thread Boszormenyi Zoltan
Hi, 2012-10-03 10:25 keltezéssel, Magnus Hagander írta: On Tue, Jul 3, 2012 at 9:47 PM, Peter Eisentraut wrote: On mån, 2012-07-02 at 01:10 +0900, Fujii Masao wrote: But I think that part is lacking in functionality: AFAICT it's hardcoded to only handle host, port, user and password. What abo

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Simon Riggs
On 3 October 2012 09:10, Andres Freund wrote: >> The following restrictions are applied. >> - REINDEX [ DATABASE | SYSTEM ] cannot be run concurrently. > I would like to support something like REINDEX USER TABLES; or similar at some > point, but that very well can be a second phase. Yes, that w

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Michael Paquier
On Wed, Oct 3, 2012 at 5:10 PM, Andres Freund wrote: > > This basically allows to perform read and write operations on a table > whose > > index(es) are reindexed at the same time. Pretty useful for a production > > environment. The caveats of this feature is that it is slower than > normal > > r

Re: [HACKERS] [PATCH] Make pg_basebackup configure and start standby

2012-10-03 Thread Magnus Hagander
On Tue, Jul 3, 2012 at 9:47 PM, Peter Eisentraut wrote: > On mån, 2012-07-02 at 01:10 +0900, Fujii Masao wrote: >> > But I think that part is lacking in functionality: AFAICT it's >> > hardcoded to only handle host, port, user and password. What about >> > other connection parameters, likely passe

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Andres Freund
Hi, On Wednesday, October 03, 2012 03:14:17 AM Michael Paquier wrote: > One of the outputs on the discussions about the integration of pg_reorg in > core > was that Postgres should provide some ways to do REINDEX, CLUSTER and ALTER > TABLE concurrently with low-level locks in a way similar to CREA

Re: [HACKERS] Support for REINDEX CONCURRENTLY

2012-10-03 Thread Simon Riggs
On 3 October 2012 02:14, Michael Paquier wrote: > Well, I spent some spare time working on the implementation of REINDEX > CONCURRENTLY. Thanks > The following restrictions are applied. > - REINDEX [ DATABASE | SYSTEM ] cannot be run concurrently. Fair enough > - indexes for exclusion constra