Re: postgres_fdw vs data formatting GUCs (was Re: [HACKERS] [v9.3] writable foreign tables)

2013-03-20 Thread Daniel Farina
On Tue, Mar 19, 2013 at 10:37 PM, Daniel Farina dan...@heroku.com wrote: I added programming around various NULL returns reading GUCs in this revision, v4. Okay, one more of those fridge-logic bugs. Sorry for the noise. v5. A missing PG_RETHROW to get the properly finally-esque semantics:

Re: [HACKERS] Ignore invalid indexes in pg_dump

2013-03-20 Thread Simon Riggs
On 20 March 2013 02:51, Michael Paquier michael.paqu...@gmail.com wrote: If failures happen with CREATE INDEX CONCURRENTLY, the system will be let with invalid indexes. I don't think that the user would like to see invalid indexes of an existing system being recreated as valid after a

Re: [HACKERS] machine-parseable object descriptions

2013-03-20 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@2ndquadrant.com writes: All in all, I'm happy with this and I'm considering committing it as soon as we agree on the set of columns. I'm mildly on the side of removing the separate schema column and keeping name, so we'd have type/name/identity. I would prefer that we

Re: [HACKERS] Improving avg performance for numeric

2013-03-20 Thread Pavel Stehule
Hello 2013/3/19 Tom Lane t...@sss.pgh.pa.us: I wrote: [ looks at patch... ] Oh, I see what's affecting the plan: you changed the aggtranstypes to internal for a bunch of aggregates. That's not very good, because right now the planner takes that to mean that the aggregate could eat a lot of

[HACKERS] A few string fixed

2013-03-20 Thread Daniele Varrazzo
Hello, while translating the new PostgreSQL 9.3 strings I've found a couple questionable. Patches attached. Cheers, -- Daniele 0001-Fixed-MultiXactIds-string-warning.patch Description: Binary data 0002-Fixed-pasto-in-hint-string-about-making-views-deleta.patch Description: Binary data --

Re: [HACKERS] Enabling Checksums

2013-03-20 Thread Greg Stark
On Mon, Mar 18, 2013 at 5:52 PM, Bruce Momjian br...@momjian.us wrote: With a potential 10-20% overhead, I am unclear who would enable this at initdb time. For what it's worth I think cpu overhead of the checksum is totally a red herring.. Of course there's no reason not to optimize it to be as

Re: [HACKERS] Enabling Checksums

2013-03-20 Thread Bruce Momjian
On Mon, Mar 18, 2013 at 01:52:58PM -0400, Bruce Momjian wrote: I assume a user would wait until they suspected corruption to turn it on, and because it is only initdb-enabled, they would have to dump/reload their cluster. The open question is whether this is a usable feature as written, or

Re: [HACKERS] A few string fixed

2013-03-20 Thread Tom Lane
Daniele Varrazzo daniele.varra...@gmail.com writes: while translating the new PostgreSQL 9.3 strings I've found a couple questionable. Patches attached. Hmm ... I agree with the MultiXactId-MultiXactIds changes, but not with this one: -

Re: [HACKERS] machine-parseable object descriptions

2013-03-20 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: The new identity column is amazingly verbose on things like pg_amproc entries: 10650 | 1 (pg_catalog.point, pg_catalog.point) of pg_catalog.point_ops for gist:

[HACKERS] Materialized views vs event triggers missing docs?

2013-03-20 Thread Magnus Hagander
The table at http://www.postgresql.org/docs/devel/static/event-trigger-matrix.html does not include things like CREATE MATERIALIZED VIEW or REFRESH MATERIALIZED VIEW. but they certainly seem to work? Just a missing doc patch, or is there something in the code that's not behaving as intended? If

[HACKERS] Problem with background worker

2013-03-20 Thread Marc Cousin
Hi, I'm trying to write a background writer, and I'm facing a problem with timestamps. The following code is where I'm having a problem (it's just a demo for the problem): BackgroundWorkerInitializeConnection(test, NULL); while (!got_sigterm) { int ret; /* Wait 1s */ ret

Re: postgres_fdw vs data formatting GUCs (was Re: [HACKERS] [v9.3] writable foreign tables)

2013-03-20 Thread Tom Lane
Daniel Farina dan...@heroku.com writes: Okay, one more of those fridge-logic bugs. Sorry for the noise. v5. A missing PG_RETHROW to get the properly finally-esque semantics: --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -642,7 +642,10 @@ dblink_fetch(PG_FUNCTION_ARGS) }

Re: [HACKERS] Problem with background worker

2013-03-20 Thread Alvaro Herrera
Marc Cousin escribió: Hi, I'm trying to write a background writer, and I'm facing a problem with timestamps. The following code is where I'm having a problem (it's just a demo for the problem): BackgroundWorkerInitializeConnection(test, NULL); while (!got_sigterm) { int ret;

Re: [HACKERS] Ignore invalid indexes in pg_dump

2013-03-20 Thread Josh Kupershmidt
On Wed, Mar 20, 2013 at 2:00 AM, Simon Riggs si...@2ndquadrant.com wrote: On 20 March 2013 02:51, Michael Paquier michael.paqu...@gmail.com wrote: If failures happen with CREATE INDEX CONCURRENTLY, the system will be let with invalid indexes. I don't think that the user would like to see

Re: [HACKERS] Ignore invalid indexes in pg_dump

2013-03-20 Thread Tom Lane
Josh Kupershmidt schmi...@gmail.com writes: On Wed, Mar 20, 2013 at 2:00 AM, Simon Riggs si...@2ndquadrant.com wrote: Invalid also means currently-in-progress, so it would be better to keep them in. For invalid indexes which are left hanging around in the database, if the index definition

Re: [HACKERS] [pgsql-advocacy] Call for Google Summer of Code mentors, admins

2013-03-20 Thread Thom Brown
On 19 March 2013 17:42, Thom Brown t...@linux.com wrote: On 14 February 2013 18:02, Josh Berkus j...@agliodbs.com wrote: Folks, Once again, Google is holding Summer of Code. We need to assess whether we want to participate this year. Questions: - Who wants to mentor for GSOC? - Who can

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Bruce Momjian
On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote: so it is clearly possible for PQconndefaults() to return NULL for service file failures. The questions are: * Is this what we want? What other choices do we have? I don't think PQconndefaults() should continue on as if

Re: [HACKERS] Problem with background worker

2013-03-20 Thread Marc Cousin
On 20/03/2013 16:33, Alvaro Herrera wrote: Marc Cousin escribió: Hi, I'm trying to write a background writer, and I'm facing a problem with timestamps. The following code is where I'm having a problem (it's just a demo for the problem): BackgroundWorkerInitializeConnection(test, NULL); while

Re: [HACKERS] Problem with background worker

2013-03-20 Thread Alvaro Herrera
Marc Cousin escribió: On 20/03/2013 16:33, Alvaro Herrera wrote: Ah. The reason for this problem is that the statement start time (which also sets the transaction start time, when it's the first statement) is set by postgres.c, not the transaction-control functions in xact.c. So you'd need

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote: * Should we document this? Yes the documentation should indicate that PQconndefaults() can return NULL for more than just memory failures. The attached patch fixes this. I am unclear about

Re: [HACKERS] A few string fixed

2013-03-20 Thread Daniele Varrazzo
On Wed, Mar 20, 2013 at 2:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: while translating the new PostgreSQL 9.3 strings I've found a couple questionable. Patches attached. Hmm ... I agree with the MultiXactId-MultiXactIds changes, but not with

Re: [HACKERS] Improving avg performance for numeric

2013-03-20 Thread Hadi Moshayedi
Hi Tom, Tom Lane t...@sss.pgh.pa.us wrote: After thinking about that for awhile: if we pursue this type of optimization, what would probably be appropriate is to add an aggregate property (stored in pg_aggregate) that allows direct specification of the size that the planner should assume for

Re: postgres_fdw vs data formatting GUCs (was Re: [HACKERS] [v9.3] writable foreign tables)

2013-03-20 Thread Daniel Farina
On Wed, Mar 20, 2013 at 7:43 AM, Tom Lane t...@sss.pgh.pa.us wrote: Daniel Farina dan...@heroku.com writes: Okay, one more of those fridge-logic bugs. Sorry for the noise. v5. A missing PG_RETHROW to get the properly finally-esque semantics: --- a/contrib/dblink/dblink.c +++

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Bruce Momjian
On Wed, Mar 20, 2013 at 12:30:32PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote: * Should we document this? Yes the documentation should indicate that PQconndefaults() can return NULL for more than just

Re: [HACKERS] [pgsql-advocacy] Call for Google Summer of Code mentors, admins

2013-03-20 Thread Atri Sharma
It does sound nice,something like cron? We can use a scheduling algorithm, and can define a pool of tasks as well as a time constraint for the amount of time which can be used for running the tasks.Then, a scheduling algorithm can pick tasks from the pool based on priorities and the time

Re: postgres_fdw vs data formatting GUCs (was Re: [HACKERS] [v9.3] writable foreign tables)

2013-03-20 Thread Tom Lane
Daniel Farina dan...@heroku.com writes: On Wed, Mar 20, 2013 at 7:43 AM, Tom Lane t...@sss.pgh.pa.us wrote: Um ... you shouldn't need a PG_TRY for that at all. guc.c will take care of popping the values on transaction abort --- that's really rather the whole point of having that mechanism.

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Wed, Mar 20, 2013 at 12:30:32PM -0400, Tom Lane wrote: I think we should either change PQconndefaults to *not* fail in this circumstance, or find a way to return an error message. Well, Steve Singer didn't like the idea of ignoring a service lookup

[HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Tom Lane
I was just looking into why the -DCLOBBER_CACHE_ALWAYS buildfarm critters aren't managing to run the new timeouts isolation test successfully, despite very generous timeouts. The answer is that 2 seconds isn't quite enough time to parse+plan+execute the query that isolationtester uses to see if

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Bruce Momjian
On Wed, Mar 20, 2013 at 01:30:20PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Wed, Mar 20, 2013 at 12:30:32PM -0400, Tom Lane wrote: I think we should either change PQconndefaults to *not* fail in this circumstance, or find a way to return an error message. Well,

Re: [HACKERS] Materialized view assertion failure in HEAD

2013-03-20 Thread Robert Haas
On Mon, Mar 18, 2013 at 4:42 PM, Kevin Grittner kgri...@ymail.com wrote: I want to give everyone else a chance to weigh in before I start the pendulum swinging back in the other direction on OIDs in MVs. Opinions? I agree that it's probably better to just disallow this, but I have to admit I

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Robert Haas
On Wed, Mar 20, 2013 at 2:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I was just looking into why the -DCLOBBER_CACHE_ALWAYS buildfarm critters aren't managing to run the new timeouts isolation test successfully, despite very generous timeouts. The answer is that 2 seconds isn't quite enough

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Alvaro Herrera
Robert Haas escribió: On Wed, Mar 20, 2013 at 2:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I was just looking into why the -DCLOBBER_CACHE_ALWAYS buildfarm critters aren't managing to run the new timeouts isolation test successfully, despite very generous timeouts. The answer is that 2

Re: [HACKERS] machine-parseable object descriptions

2013-03-20 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: One change I made was to move all the new code from dependency.c into objectaddress.c. The only reason it was in dependency.c was that getObjectDescription was there in the first place; but it doesn't seem to me that it really belongs there.

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Greg Stark
On Wed, Mar 20, 2013 at 6:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I propose that we should add a backend function that simplifies this type of query. The API that comes to mind is (name subject to bikeshedding) pg_blocking_pids(pid int) returns int[] I've wanted to use pg_locks as

Re: [HACKERS] Materialized view assertion failure in HEAD

2013-03-20 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Kevin Grittner kgri...@ymail.com wrote: I want to give everyone else a chance to weigh in before I start the pendulum swinging back in the other direction on OIDs in MVs. Opinions? I agree that it's probably better to just disallow this, but I have to

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Tom Lane
Greg Stark st...@mit.edu writes: On Wed, Mar 20, 2013 at 6:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I propose that we should add a backend function that simplifies this type of query. The API that comes to mind is (name subject to bikeshedding) pg_blocking_pids(pid int) returns int[]

Re: [HACKERS] find libxml2 using pkg-config

2013-03-20 Thread Peter Eisentraut
On 3/4/13 1:36 PM, Noah Misch wrote: Do you have in mind a target system exhibiting a problem? CentOS 6 ships a single xml2-config, but its --cflags --libs output is the same regardless of the installed combination of libxml2-dev packages. Ubuntu 13.04 does not ship 32-bit libxml2, so it

Re: [HACKERS] machine-parseable object descriptions

2013-03-20 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: One change I made was to move all the new code from dependency.c into objectaddress.c. The only reason it was in dependency.c was that getObjectDescription was there in the first place; but it doesn't seem to me that it

Re: [HACKERS] sql_drop Event Triggerg

2013-03-20 Thread Alvaro Herrera
Here's a new version of this patch, rebased on top of the new pg_identify_object() stuff. Note that the regression test doesn't work yet, because I didn't adjust to the new identity output definition (the docs need work, too). But that's a simple change to do. I'm leaving that for later. --

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Steve Singer
On 13-03-20 02:17 PM, Bruce Momjian wrote: On Wed, Mar 20, 2013 at 01:30:20PM -0400, Tom Lane wrote: While this surely isn't the nicest answer, it doesn't seem totally unreasonable to me. A bad service name indeed does not contribute anything to the set of defaults available. I think the

[HACKERS] Should commit_delay be PGC_SIGHUP?

2013-03-20 Thread Peter Geoghegan
I realize that this isn't terribly critical, but I'd like to suggest that commit_delay be made PGC_SIGHUP on 9.3 (it's currently PGC_USERSET). It's not that a poorly chosen commit_delay setting has the potential to adversely affect other backends where the setting *has* been set in those other

Re: [HACKERS] pg_upgrade segfaults when given an invalid PGSERVICE value

2013-03-20 Thread Tom Lane
Steve Singer ssin...@ca.afilias.info writes: On 13-03-20 02:17 PM, Bruce Momjian wrote: I think the concern is that the services file could easily change the defaults that are used for connecting, though you could argue that the real defaults for a bad service entry are properly returned.

Re: [HACKERS] [pgsql-advocacy] Call for Google Summer of Code mentors, admins

2013-03-20 Thread Dimitri Fontaine
Atri Sharma atri.j...@gmail.com writes: We can use a scheduling algorithm, and can define a pool of tasks as well as a time constraint for the amount of time which can be used for running the tasks.Then, a scheduling algorithm can pick tasks from the pool based on priorities and the time

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: I propose that we should add a backend function that simplifies this type of query. The API that comes to mind is (name subject to bikeshedding) pg_blocking_pids(pid int) returns int[] +1 If we want a global view of the who-blocks-whom situation, I

Re: [HACKERS] Materialized view assertion failure in HEAD

2013-03-20 Thread Kevin Grittner
Kevin Grittner kgri...@ymail.com wrote: Robert Haas robertmh...@gmail.com wrote: It seems to me that the right place to fix this is in interpretOidsOption(), by returning false rather than default_with_oids whenever the relation is a materialized view. I like it. In working up a patch for

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: If we want a global view of the who-blocks-whom situation, I think we'll need another approach. But since this way solves isolationtester's problem fairly neatly, I was hopeful that it would be useful for

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: pg_is_lock_exclusive(lock, lock) returns boolean pg_is_lock_exclusive(lock[], lock[]) returns boolean I suppose that the lock type would be text ('ExclusiveLock'), but we could also expose a new ENUM type for that (pg_lock_mode). I don't have an

[PATCH] Exorcise zero-dimensional arrays (Was: Re: [HACKERS] Should array_length() Return NULL)

2013-03-20 Thread Brendan Jurd
On 17 March 2013 05:19, Tom Lane t...@sss.pgh.pa.us wrote: Brendan Jurd dire...@gmail.com writes: On 16 March 2013 09:07, Tom Lane t...@sss.pgh.pa.us wrote: The thing is that that syntax creates an array of zero dimensions, not one that has 1 dimension and zero elements. I'm going to ask the

Re: [PATCH] Exorcise zero-dimensional arrays (Was: Re: [HACKERS] Should array_length() Return NULL)

2013-03-20 Thread David E. Wheeler
On Mar 20, 2013, at 4:45 PM, Brendan Jurd dire...@gmail.com wrote: I submit a patch to rectify the weird and confusing quirk of Postgres to use zero dimensions to signify an empty array. Epic. Thank you. I’m very glad now that I complained about this (again)! Best, David -- Sent via

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Simon Riggs
On 20 March 2013 18:02, Tom Lane t...@sss.pgh.pa.us wrote: The API that comes to mind is (name subject to bikeshedding) pg_blocking_pids(pid int) returns int[] Useful. Can we also have an SRF rather than an array? Does the definition as an array imply anything about our ability to

Re: [HACKERS] Should commit_delay be PGC_SIGHUP?

2013-03-20 Thread Simon Riggs
On 20 March 2013 21:50, Peter Geoghegan p...@heroku.com wrote: I realize that this isn't terribly critical, but I'd like to suggest that commit_delay be made PGC_SIGHUP on 9.3 (it's currently PGC_USERSET). It's not that a poorly chosen commit_delay setting has the potential to adversely affect

Re: [HACKERS] find libxml2 using pkg-config

2013-03-20 Thread Noah Misch
On Wed, Mar 20, 2013 at 05:17:11PM -0400, Peter Eisentraut wrote: On 3/4/13 1:36 PM, Noah Misch wrote: Do you have in mind a target system exhibiting a problem? CentOS 6 ships a single xml2-config, but its --cflags --libs output is the same regardless of the installed combination of

Re: [HACKERS] Ignore invalid indexes in pg_dump

2013-03-20 Thread Michael Paquier
On Thu, Mar 21, 2013 at 12:58 AM, Tom Lane t...@sss.pgh.pa.us wrote: I had been on the fence about what to do here, but I find Josh's arguments persuasive, particularly the second one. Why shouldn't we consider an in-progress index to be an uncommitted DDL change? (Now admittedly, there

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Noah Misch
On Wed, Mar 20, 2013 at 02:02:32PM -0400, Tom Lane wrote: [fun query for appraising lock contention] This is way more knowledge than we (should) want a client to embed about which lock types block which others. What's worse, it's still wrong. The query will find cases where one of the test

Re: [HACKERS] Let's invent a function to report lock-wait-blocking PIDs

2013-03-20 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On 20 March 2013 18:02, Tom Lane t...@sss.pgh.pa.us wrote: The API that comes to mind is (name subject to bikeshedding) pg_blocking_pids(pid int) returns int[] Useful. Can we also have an SRF rather than an array? I thought about that, but at

Re: [HACKERS] [pgsql-advocacy] Call for Google Summer of Code mentors, admins

2013-03-20 Thread Magnus Hagander
On Mar 20, 2013 11:14 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Atri Sharma atri.j...@gmail.com writes: We can use a scheduling algorithm, and can define a pool of tasks as well as a time constraint for the amount of time which can be used for running the tasks.Then, a scheduling

Re: [HACKERS] find libxml2 using pkg-config

2013-03-20 Thread Tom Lane
Noah Misch n...@leadboat.com writes: On Wed, Mar 20, 2013 at 05:17:11PM -0400, Peter Eisentraut wrote: On 3/4/13 1:36 PM, Noah Misch wrote: Do you have in mind a target system exhibiting a problem? CentOS 6 ships a single xml2-config, but its --cflags --libs output is the same regardless of

Re: [HACKERS] Single-argument variant for array_length and friends?

2013-03-20 Thread Tom Lane
Brendan Jurd dire...@gmail.com writes: While I was working on my empty array patch I was frequently irritated by the absence of an array_length(anyarray). The same goes for array_upper and array_lower. Most of the time when I work with arrays, they are 1-D, and it's inelegant to having to

Re: [HACKERS] Trust intermediate CA for client certificates

2013-03-20 Thread Craig Ringer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/19/2013 09:46 PM, Stephen Frost wrote: * Craig Ringer (cr...@2ndquadrant.com) wrote: As far as I'm concerned that's the immediate problem fixed. It may be worth adding a warning on startup if we find non-self-signed certs in root.crt too,