[HACKERS] [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

2013-08-12 Thread Pavel Raiskup
The latest update on original bug report at Red Hat bugzilla shows that the reproducer is just disable the peer access for 'postgres' user in pg_hba.conf. So — the old server was most probably still running for OP (not shut down properly as was originally said). But basically, this fix is

Re: [HACKERS] libpq thread locking during SSL connection start

2013-08-12 Thread Peter Eisentraut
On 8/1/13 1:42 PM, Stephen Frost wrote: * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: pgsecure_open_client() returns -1 if it can't lock the mutex. This is a problem because the callers are not prepared for that return value. I think it should return PGRES_POLLING_FAILED instead, after

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 12:23:59PM -0400, Bruce Momjian wrote: Yes, I have thought about this some more and another problem is that rtrim/btrim/ltrim() use the source string first, so having trim() have the source string second when using a comma is very confusing, e.g.: -- with patch

Re: [HACKERS] libpq thread locking during SSL connection start

2013-08-12 Thread Stephen Frost
* Peter Eisentraut (pete...@gmx.net) wrote: On 8/1/13 1:42 PM, Stephen Frost wrote: * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: pgsecure_open_client() returns -1 if it can't lock the mutex. This is a problem because the callers are not prepared for that return value. I think it

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-12 Thread Kodamasimham Pridhvi (MT2012066)
On Sat, 10 Aug 2013 09:33:05 -0700, Noah Misch , wrote: Note that PostgreSQL 8.3 had xmlvalidate() for a time; commit we found that, xmlvalidate() was for checking well formedness of an xml doc, not for validating against xml schema, we inferred this from Release note of 8.2 for reference,

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-12 Thread Jeff Janes
On Sat, Aug 10, 2013 at 4:26 AM, Greg Stark st...@mit.edu wrote: The problem is that I don't know of any way to detect eof on a socket other than trying to read from it (or calling poll or select). So the server would have to periodically poll the client even when it's not expecting any data.

Re: [HACKERS] pg_dump and schema names

2013-08-12 Thread Peter Eisentraut
On 8/9/13 12:04 AM, Bruce Momjian wrote: generates this output: SET search_path = xx, pg_catalog; CREATE TABLE test ( x integer ); If you dump a schema and want to reload it into another schema, you should only need to update that one search_path line. Is

Re: [HACKERS] question about HTTP API

2013-08-12 Thread Peter Eisentraut
On 8/8/13 3:44 PM, Josh Berkus wrote: Other than that, no. I was thinking of creating a general tool as a custom background worker, which would take stored procedure calls and pass them through to PostgreSQL, returning results as JSON. Mainly because I need it for a project. However, this

Re: [HACKERS] question about HTTP API

2013-08-12 Thread Szymon Guz
On 12 August 2013 18:37, Peter Eisentraut pete...@gmx.net wrote: On 8/8/13 3:44 PM, Josh Berkus wrote: Other than that, no. I was thinking of creating a general tool as a custom background worker, which would take stored procedure calls and pass them through to PostgreSQL, returning

Re: [HACKERS] pg_basebackup vs. Windows and tablespaces

2013-08-12 Thread Magnus Hagander
On Mon, Aug 5, 2013 at 10:03 PM, Noah Misch n...@leadboat.com wrote: On Thu, Aug 01, 2013 at 01:04:42PM -0400, Andrew Dunstan wrote: On 08/01/2013 12:15 PM, Noah Misch wrote: 1. Include in the base backup a file listing symbolic links/junction points, then have archive recovery recreate them.

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Based on my research, I am now proposing a new, attached patch which eliminates comma in all places in TRIM, This will break even more stuff than the last patch, ie, every single stored rule or view that contains a TRIM function. You can *not* eliminate,

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-12 Thread Tom Lane
Jeff Janes jeff.ja...@gmail.com writes: On Sat, Aug 10, 2013 at 4:26 AM, Greg Stark st...@mit.edu wrote: The problem is that I don't know of any way to detect eof on a socket other than trying to read from it (or calling poll or select). Do we know how inefficient it is, compared to the

Re: [HACKERS] pg_dump and schema names

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 12:28:26PM -0400, Peter Eisentraut wrote: On 8/9/13 12:04 AM, Bruce Momjian wrote: generates this output: SET search_path = xx, pg_catalog; CREATE TABLE test ( x integer ); If you dump a schema and want to reload it into another

Re: [HACKERS] proposal: lob conversion functionality

2013-08-12 Thread Pavel Stehule
2013/8/10 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I found so there are no simple API for working with LO from PL without access to file system. What? See lo_open(), loread(), lowrite(), etc. yes, so there are three problems with these functions: a)

Re: [HACKERS] pg_basebackup vs. Windows and tablespaces

2013-08-12 Thread Andrew Dunstan
On 08/12/2013 01:40 PM, Magnus Hagander wrote: I also like the concept of #2, but I think we need to think about it a bit more. One of the things I like about barman backups is that on recovery you can map where tablespaces go, on a per tablespace basis (it's not very well documented, or wasn't

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Tom Lane
I wrote: This will break even more stuff than the last patch, ie, every single stored rule or view that contains a TRIM function. You can *not* eliminate, or mess with, the expr_list production, because that's what dumping of these function calls relies on. No, wait, I take that back. I was

Re: [HACKERS] pg_basebackup vs. Windows and tablespaces

2013-08-12 Thread Magnus Hagander
On Mon, Aug 12, 2013 at 8:14 PM, Andrew Dunstan and...@dunslane.net wrote: On 08/12/2013 01:40 PM, Magnus Hagander wrote: I also like the concept of #2, but I think we need to think about it a bit more. One of the things I like about barman backups is that on recovery you can map where

Re: [HACKERS] pg_basebackup vs. Windows and tablespaces

2013-08-12 Thread Andrew Dunstan
On 08/12/2013 02:22 PM, Magnus Hagander wrote: On Mon, Aug 12, 2013 at 8:14 PM, Andrew Dunstan and...@dunslane.net wrote: On 08/12/2013 01:40 PM, Magnus Hagander wrote: I also like the concept of #2, but I think we need to think about it a bit more. One of the things I like about barman

Re: [HACKERS] pass-through queries to foreign servers

2013-08-12 Thread Merlin Moncure
On Mon, Aug 5, 2013 at 2:02 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello 2013/8/5 David Gudeman dave.gude...@gmail.com: For those who don't want to go to the link to see what I'm talking about with query rewrites, I thought I'd give a brief description. Foreign data wrappers

[HACKERS] Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

2013-08-12 Thread Bruce Momjian
[ fixed hackers CC address ] On Mon, Aug 12, 2013 at 12:31:10PM +0200, Pavel Raiskup wrote: The latest update on original bug report at Red Hat bugzilla shows that the reproducer is just disable the peer access for 'postgres' user in pg_hba.conf. So — the old server was most probably still

Re: [HACKERS] [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

2013-08-12 Thread Pavel Raiskup
The patch moves the atexit setting up, as you suggested, but only does that when pg_ctl succeeds (we know we started the server), Yes, of course! PG 9.1+ will allow pg_ctl -w start to succeed even if there are permissions problems; earlier versions will not and will keep the server running

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 02:18:01PM -0400, Tom Lane wrote: No, wait, I take that back. I was thinking that the function call would dump out as trim(x, y) but actually none of the underlying functions are named just trim; they're btrim, ltrim, or rtrim. So actually the dump/reload scenario

[HACKERS] Modyfication Sort Merge Join Alghoritm

2013-08-12 Thread tubadzin
Hi users. I want to sure, that is no this implementation in Postgresql: For Sorte Merge Join Alghoritm:  If the large input arrives sorted, g-join joins its pages with the buffer pool contents by strictly increasing join key values and the join output is also strictly sorted.   Is it difficult to

[HACKERS] Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 10:08:07PM +0200, Pavel Raiskup wrote: The patch moves the atexit setting up, as you suggested, but only does that when pg_ctl succeeds (we know we started the server), Yes, of course! PG 9.1+ will allow pg_ctl -w start to succeed even if there are permissions

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: We did have someone confused by what we have now, as well as me, so I think there is a reason to clean this up. It would be a backward-compatible change, though. backward-INcompatible, I assume you meant. To document this, I think we would need to add

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 04:58:23PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: We did have someone confused by what we have now, as well as me, so I think there is a reason to clean this up. It would be a backward-compatible change, though. backward-INcompatible, I

Re: [HACKERS] Modyfication Sort Merge Join Alghoritm

2013-08-12 Thread Josh Berkus
On 08/12/2013 01:31 PM, tubadzin wrote: Hi users. I want to sure, that is no this implementation in Postgresql: For Sorte Merge Join Alghoritm: If the large input arrives sorted, g-join joins its pages with the buffer pool contents by strictly increasing join key values and the join output

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-12 Thread Greg Stark
On Mon, Aug 12, 2013 at 6:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: Jeff Janes jeff.ja...@gmail.com writes: On Sat, Aug 10, 2013 at 4:26 AM, Greg Stark st...@mit.edu wrote: The problem is that I don't know of any way to detect eof on a socket other than trying to read from it (or calling poll

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-12 Thread Tom Lane
Greg Stark st...@mit.edu writes: So I poked around a bit. It looks like Linux does send a SIGIO when a tcp connection is closed (with POLL_HUP if it's closed and POLL_IN if it's half-closed). So it should be possible to arrange to get a signal which CHECK_FOR_INTERRUPTS could handle the normal

Re: [HACKERS] updatable/deletable terminology

2013-08-12 Thread Peter Eisentraut
On Wed, 2013-08-07 at 21:19 -0400, Peter Eisentraut wrote: To make the view updatable, provide an unconditional ON DELETE DO INSTEAD rule or an INSTEAD OF DELETE trigger. I think it's a bit strange to claim that adding a DELETE rule/trigger makes a view *updatable*. I suspect someone

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-12 Thread Greg Stark
On Mon, Aug 12, 2013 at 11:41 PM, Tom Lane t...@sss.pgh.pa.us wrote: That sounds like a mess --- race conditions all over the place, even aside from efficiency worries. This I don't understand. All I'm envisioning is setting a flag in the signal handler. If that flag is set then the next

Re: [HACKERS] WITH ORDINALITY planner improvements

2013-08-12 Thread Etsuro Fujita
However it occurs to me that the plan isn't ideal: postgres=# explain select * from generate_series(1,10) with ordinality as a(a,o) natural full outer join generate_series(1,5) with ordinality as b(b,o) ; QUERY PLAN

Re: [HACKERS] Modyfication Sort Merge Join Alghoritm

2013-08-12 Thread Jeff Janes
On Mon, Aug 12, 2013 at 1:31 PM, tubadzin tubad...@o2.pl wrote: Hi users. I want to sure, that is no this implementation in Postgresql: For Sorte Merge Join Alghoritm: If the large input arrives sorted, g-join joins its pages with the buffer pool contents by strictly increasing join key

Re: [HACKERS] [BUGS] BUG #8335: trim() un-document behaviour

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 05:19:30PM -0400, Bruce Momjian wrote: Attached are docs that add the new syntax, and mention it is non-standard; you can see the output here: http://momjian.us/tmp/pgsql/functions-string.html#FUNCTIONS-STRING-SQL We do document three syntaxes for substring()

Re: [HACKERS] Foreground vacuum and buffer access strategy

2013-08-12 Thread Jeff Janes
Reviving a very old thread, because I've run into the issue again. On Tue, May 29, 2012 at 11:58 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, May 25, 2012 at 4:06 PM, Jeff Janes jeff.ja...@gmail.com wrote: If I invoke vacuum manually and do so with VacuumCostDelay == 0, I have

Re: [HACKERS] StrategyGetBuffer optimization, take 2

2013-08-12 Thread Amit Kapila
Merlin Moncure wrote: On Wed, Aug 7, 2013 at 11:52 PM, Amit Kapila amit(dot)kapila(at)huawei(dot)com wrote: -Original Message- From: pgsql-hackers-owner(at)postgresql(dot)org [mailto:pgsql-hackers- owner(at)postgresql(dot)org] On Behalf Of Merlin Moncure Sent: Thursday, August 08, 2013