Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Simon Riggs
On Tue, Mar 6, 2012 at 3:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: But having said that, it's not apparent to me why such a thing would need to live inside the database at all.  It's very easy to visualize a task scheduler that runs as a client and requires nothing new from the core code.  

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Pavel Stehule
2012/3/7 Simon Riggs si...@2ndquadrant.com: On Tue, Mar 6, 2012 at 3:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: But having said that, it's not apparent to me why such a thing would need to live inside the database at all.  It's very easy to visualize a task scheduler that runs as a client and

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Simon Riggs
On Tue, Mar 6, 2012 at 8:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 06.03.2012 17:12, Tom Lane wrote: How long is the current locked code exactly --- does it contain a loop? Perhaps best if you take a look for yourself, the

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Gokulakannan Somasundaram
I feel sad, that i followed this topic very late. But i still want to put forward my views. Have we thought on the lines of how Robert has implemented relation level locks. In short it should go like this a) The locks for enforcing Referential integrity should be taken only when the rarest of the

Re: [HACKERS] [9.2] Confusion over CacheRegisterSyscacheCallback

2012-03-07 Thread Marko Kreen
On Tue, Mar 06, 2012 at 04:27:11PM -0500, Tom Lane wrote: Marko Kreen mark...@gmail.com writes: On Tue, Mar 06, 2012 at 11:10:38AM -0500, Tom Lane wrote: Why would you need to know that? The reason the calculation function is static is that there's no apparent need to expose that

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 9:24 AM, Gokulakannan Somasundaram gokul...@gmail.com wrote: I feel sad, that i followed this topic very late. But i still want to put forward my views. Have we thought on the lines of how Robert has implemented relation level locks. In short it should go like this a)

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Gokulakannan Somasundaram
Insert, Update and Delete don't take locks they simply mark the tuples they change with an xid. Anybody else wanting to wait on the lock just waits on the xid. We do insert a lock row for each xid, but not one per row changed. I mean the foreign key checks here. They take a Select for Share

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 10:18 AM, Gokulakannan Somasundaram gokul...@gmail.com wrote: Insert, Update and Delete don't take locks they simply mark the tuples they change with an xid. Anybody else wanting to wait on the lock just waits on the xid. We do insert a lock row for each xid, but not

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Gokulakannan Somasundaram
Please explain in detail your idea of how it will work. OK. I will try to explain the abstract idea, i have. a) Referential integrity gets violated, when there are referencing key values, not present in the referenced key values. We are maintaining the integrity by taking a Select for Share

[HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
Hi, pg_stat_statements is basically very helpful to find out slow queries. But since it doesn't report the time spent in the planner, we cannot find out slow queries which take most time to do query planning, from pg_stat_statements. Is there any reason why pg_stat_statements doesn't collect the

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 11:45 AM, Fujii Masao masao.fu...@gmail.com wrote: Attached patch extends pg_stat_statements so that it reports the planning time. Thought? If we successfully aggregate SQL in the current patch then this might be useful as well. Until we do that it's not much use. --  

Re: [HACKERS] foreign key locks, 2nd attempt

2012-03-07 Thread Simon Riggs
n Wed, Mar 7, 2012 at 11:37 AM, Gokulakannan Somasundaram gokul...@gmail.com wrote: Please explain in detail your idea of how it will work. So we will take some kind of lock, which will stop such a happening. ... May be someone can come up with better ideas than this. With respect, I don't

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Wed, Mar 7, 2012 at 9:00 PM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, Mar 7, 2012 at 11:45 AM, Fujii Masao masao.fu...@gmail.com wrote: Attached patch extends pg_stat_statements so that it reports the planning time. Thought? If we successfully aggregate SQL in the current patch

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Noah Misch
On Tue, Mar 06, 2012 at 08:36:05AM -0500, Robert Haas wrote: On Tue, Mar 6, 2012 at 5:43 AM, Noah Misch n...@leadboat.com wrote: Well, consider something like CLUSTER. ?It's perfectly OK for CLUSTER to operate on a table that has been truncated since CLUSTER's snapshot was taken, and no

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Alvaro Herrera
Excerpts from Simon Riggs's message of mié mar 07 05:35:44 -0300 2012: On Tue, Mar 6, 2012 at 8:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 06.03.2012 17:12, Tom Lane wrote: How long is the current locked code exactly --- does

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Alvaro Herrera
Excerpts from Simon Riggs's message of mié mar 07 05:15:03 -0300 2012: We talked about this at last year's Dev meeting. And we got sidetracked into what we really want is stored procedures. Maybe we want that, but its a completely separate thing. Please lets not get distracted from a very

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Larry Rosenman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/6/2012 8:32 AM, Robert Haas wrote: On Mon, Mar 5, 2012 at 4:40 PM, Larry Rosenman l...@lerctr.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is there any way to get more info out of CLUSTER VERBOSE so it says what index it's

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 9:33 AM, Larry Rosenman l...@lerctr.org wrote: Is there any way to get more info out of CLUSTER VERBOSE so it says what index it's working on AFTER the table re-write? INFO:  clustering public.values using sequential scan and sort INFO:  values: found 0 removable,

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 7:49 AM, Noah Misch n...@leadboat.com wrote: On Tue, Mar 06, 2012 at 08:36:05AM -0500, Robert Haas wrote: On Tue, Mar 6, 2012 at 5:43 AM, Noah Misch n...@leadboat.com wrote: Well, consider something like CLUSTER. ?It's perfectly OK for CLUSTER to operate on a table

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Just to keep things in perspective -- For a commit record to reach one megabyte, it would have to be a transaction that drops over 43k tables. Or have 64k smgr inval messages (for example, a TRUNCATE might send half a dozen of these messages).

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 3:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Just to keep things in perspective -- For a commit record to reach one megabyte, it would have to be a transaction that drops over 43k tables. Or have 64k smgr inval messages

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 2:59 PM, Robert Haas robertmh...@gmail.com wrote: All true. So gentlemen, do we think this is worth pursuing further for this release? I'm sure usual arguments apply all round, so I'll skip that part. --  Simon Riggs   http://www.2ndQuadrant.com/  

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On Wed, Mar 7, 2012 at 3:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: So they are undoubtely rare.  Not sure if as rare as Higgs bosons. Even if they're rare, having a major performance hiccup when one

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 6:45 AM, Fujii Masao masao.fu...@gmail.com wrote: pg_stat_statements is basically very helpful to find out slow queries. But since it doesn't report the time spent in the planner, we cannot find out slow queries which take most time to do query planning, from

Re: Scaling XLog insertion (was Re: [HACKERS] Moving more work outside WALInsertLock)

2012-03-07 Thread Jeff Janes
On Mon, Mar 5, 2012 at 8:50 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: That particular issue would be very hard to hit in practice, so I don't know if this could explain the recovery failures that Jeff saw. I got the test script running (thanks for that Jeff!), but

Re: [HACKERS] review: CHECK FUNCTION statement

2012-03-07 Thread Pavel Stehule
Hello multicheck for triggers are supported now CHECK TRIGGER ALL; CHECK TRIGGER ALL IN SCHEMA xxx FOR ROLE yyy; Regards Pavel Stehule check_function-2012-03-07-2.patch.gz Description: GNU Zip compressed data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time is confusing and ISTM it should be renamed... Well, if we were

Re: [HACKERS] a slightly stale comment

2012-03-07 Thread Kevin Grittner
Simon Riggs si...@2ndquadrant.com wrote: Dan Ports d...@csail.mit.edu wrote: While mucking around in src/backend/utils/time/tqual.c today, I noticed the following comment attached to HeapTupleSatisfiesNow: [a comment explaining that if you think the code needs to be changed, you are

Re: [HACKERS] [9.2] Confusion over CacheRegisterSyscacheCallback

2012-03-07 Thread Tom Lane
Marko Kreen mark...@gmail.com writes: On Tue, Mar 06, 2012 at 04:27:11PM -0500, Tom Lane wrote: Or you could do like setrefs.c does, and assume you know how to calculate the hash value for an OID-keyed cache. Ok, the hashoid() hack works. But please take it as report from the ground that

Re: [HACKERS] WIP: URI connection string support for libpq

2012-03-07 Thread Alex Shulgin
Peter Eisentraut pete...@gmx.net writes: I've included a (separate) test shell script based on Greg's cases in one of the updates. What would be preferred place to plug it in? Override installcheck in libpq Makefile? I think that would be the right place. I figured that adding this right

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 12:17 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Robert, please, can you comment to this issue? And other, please. I am able to fix syntax to any form where we will have agreement. Well, so far I don't see that anyone has offered a compelling reason why this needs

Re: [HACKERS] [9.2] Confusion over CacheRegisterSyscacheCallback

2012-03-07 Thread Marko Kreen
On Wed, Mar 07, 2012 at 11:16:06AM -0500, Tom Lane wrote: Marko Kreen mark...@gmail.com writes: On Tue, Mar 06, 2012 at 04:27:11PM -0500, Tom Lane wrote: Or you could do like setrefs.c does, and assume you know how to calculate the hash value for an OID-keyed cache. Ok, the hashoid()

Re: [HACKERS] patch for a locale-specific bug in regression tests (REL9_1_STABLE)

2012-03-07 Thread Robert Haas
On Tue, Mar 6, 2012 at 1:59 PM, Tomas Vondra t...@fuzzy.cz wrote: I've noticed a locale-specific bug in regression tests, I discovered thanks to the new magpie buildfarm member (testing cs_CZ locale). The problem is in foreign_data where the output is sorted by a column, and cs_CZ behaves

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Just to be clear, I am not proposing that we get rid of CHECK TRIGGER and keep CHECK FUNCTION. I'm proposing that we get rid of all of the dedicated syntax support, and expose it all through one or more SQL-callable functions. This seems entirely

Re: [HACKERS] a slightly stale comment

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 4:09 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: What part of it do you find to be accurate or helpful? I think its funny and scary, as well as being of historical interest. But please suggest a new wording so we can discuss it. --  Simon Riggs

Re: [HACKERS] Checksums, state of play

2012-03-07 Thread Robert Haas
On Tue, Mar 6, 2012 at 2:27 PM, Bruce Momjian br...@momjian.us wrote: The feature is no where near complete, and we should not be designing features at this stage. I agree, on both counts. Although Simon did a good job pulling together something that basically works in a short amount of time,

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
2012/3/7 Robert Haas robertmh...@gmail.com: On Wed, Mar 7, 2012 at 12:17 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Robert, please, can you comment to this issue? And other, please. I am able to fix syntax to any form where we will have agreement. Well, so far I don't see that anyone

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 12:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: If we need both plpgsql_check_function(procoid) and plpgsql_check_trigger(tgoid), no problem. FWIW, I would suggest check_trigger(regclass, name) not tgoid, because we do not have a regtrigger convenience type (and I don't

Re: [HACKERS] a slightly stale comment

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 12:17 PM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, Mar 7, 2012 at 4:09 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: What part of it do you find to be accurate or helpful? I think its funny and scary, as well as being of historical interest. But

Re: [HACKERS] a slightly stale comment

2012-03-07 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Simon Riggs si...@2ndquadrant.com wrote: I think its funny and scary, as well as being of historical interest. Well, I something of a similar reaction, but I think that's outweighed by the probable waste of time for anyone trying to make sense of it.

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 10:26 AM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, Mar 7, 2012 at 2:59 PM, Robert Haas robertmh...@gmail.com wrote: All true. So gentlemen, do we think this is worth pursuing further for this release? I'm sure usual arguments apply all round, so I'll skip that

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
2012/3/7 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: Just to be clear, I am not proposing that we get rid of CHECK TRIGGER and keep CHECK FUNCTION.  I'm proposing that we get rid of all of the dedicated syntax support, and expose it all through one or more

Re: [HACKERS] WIP: URI connection string support for libpq

2012-03-07 Thread Peter Eisentraut
On ons, 2012-03-07 at 18:31 +0200, Alex Shulgin wrote: I figured that adding this right into src/interfaces/libpq is polluting the source dir, so I've used src/test instead. I would prefer src/interfaces/libpq/test, to keep it close to the code. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mié mar 07 11:57:41 -0300 2012: Seems like a good enhancement to me, if someone can figure out how to do it cleanly. Unfortunately those debug messages may not be in a place where it's real easy for them to know whether they're being called from

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Larry Rosenman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/7/2012 12:31 PM, Alvaro Herrera wrote: Excerpts from Robert Haas's message of mié mar 07 11:57:41 -0300 2012: Seems like a good enhancement to me, if someone can figure out how to do it cleanly. Unfortunately those debug messages may not

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Daniel Farina
On Wed, Mar 7, 2012 at 8:07 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Mar 7, 2012 at 12:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: More importantly, I do not agree with requiring the user to specify the language name --- that is, it should be check_function(procoid) and have that look up a language-specific

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 5:39 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 10:26 AM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, Mar 7, 2012 at 2:59 PM, Robert Haas robertmh...@gmail.com wrote: All true. So gentlemen, do we think this is worth pursuing further for

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
2012/3/7 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: On Wed, Mar 7, 2012 at 12:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: More importantly, I do not agree with requiring the user to specify the language name --- that is, it should be check_function(procoid) and have

Re: [HACKERS] WIP: URI connection string support for libpq

2012-03-07 Thread Alexander Shulgin
On 03/07/2012 08:03 PM, Peter Eisentraut wrote: On ons, 2012-03-07 at 18:31 +0200, Alex Shulgin wrote: I figured that adding this right into src/interfaces/libpq is polluting the source dir, so I've used src/test instead. I would prefer src/interfaces/libpq/test, to keep it close to the

[HACKERS] PGXS ignores SHLIB_LINK when linking modules

2012-03-07 Thread Marti Raudsepp
Hi, I'm trying to write my first PostgreSQL C extension. I used the pgxn-utils skeleton as a base and specified some external libraries in SHLIB_LINK. However, this variable was ignored when linking the library (using pgxs from current git master). After spending quite a bit of time trying to

Re: [HACKERS] Memory usage during sorting

2012-03-07 Thread Robert Haas
On Sat, Mar 3, 2012 at 4:15 PM, Jeff Janes jeff.ja...@gmail.com wrote: The better solution would be to reduce the overhead in the first place.  While building the initial runs, there is no reason to have 3 blocks worth of overhead for each tape, when only one tape is ever being used at a time.

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:15 AM, Simon Riggs si...@2ndquadrant.com wrote: We talked about this at last year's Dev meeting. And we got sidetracked into what we really want is stored procedures. Maybe we want that, but its a completely separate thing. Please lets not get distracted from a very

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 2:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Mar 7, 2012 at 12:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: More importantly, I do not agree with requiring the user to specify the language name --- that is, it should be

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
2012/3/7 Robert Haas robertmh...@gmail.com: On Wed, Mar 7, 2012 at 2:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Mar 7, 2012 at 12:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: More importantly, I do not agree with requiring the user to specify the

Re: [HACKERS] patch for a locale-specific bug in regression tests (REL9_1_STABLE)

2012-03-07 Thread Tomas Vondra
On 7.3.2012 17:56, Robert Haas wrote: On Tue, Mar 6, 2012 at 1:59 PM, Tomas Vondra t...@fuzzy.cz wrote: I've noticed a locale-specific bug in regression tests, I discovered thanks to the new magpie buildfarm member (testing cs_CZ locale). The problem is in foreign_data where the output is

Re: [HACKERS] Checksums, state of play

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 5:28 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Mar 6, 2012 at 2:27 PM, Bruce Momjian br...@momjian.us wrote: The feature is no where near complete, and we should not be designing features at this stage. I agree, on both counts.  Although Simon did a good job

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 2:06 PM, Simon Riggs si...@2ndquadrant.com wrote: I am not thrilled with the design as it stands, but bulk loading is a known and serious pain point for us, so it would be awfully nice to improve it.  I'm not sure whether we should only go as far as setting

Re: [HACKERS] Checksums, state of play

2012-03-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: So I think it's time to push this one out to 9.3. Frankly, I thought it was probably too late for 9.2 when it was first proposed, and the number of issues that have been identified since then just confirm that feeling. There is another point beyond the

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 7:55 PM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Mar 7, 2012 at 2:15 AM, Simon Riggs si...@2ndquadrant.com wrote: We talked about this at last year's Dev meeting. And we got sidetracked into what we really want is stored procedures. Maybe we want that, but its a

Re: [HACKERS] Checksums, state of play

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 3:09 PM, Simon Riggs si...@2ndquadrant.com wrote: Neither do I. It's pretty clear from our last discussion that the fix proposed doesn't actually work fully so I don't think its going to be either more robust or more certain to give low false positives. So I don't think

Re: [HACKERS] NULL's support in SP-GiST

2012-03-07 Thread Robert Haas
On Tue, Feb 28, 2012 at 5:20 PM, Jaime Casanova ja...@2ndquadrant.com wrote: On Thu, Feb 2, 2012 at 4:26 PM, Oleg Bartunov o...@sai.msu.su wrote: attached patch introduces NULLs indexing for SP-GiST. With this patch Sp-GiST supports IS NULL, IS NOT NULL clauses, as well as full index scan. I

Re: [HACKERS] patch for a locale-specific bug in regression tests (REL9_1_STABLE)

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 3:08 PM, Tomas Vondra t...@fuzzy.cz wrote: On 7.3.2012 17:56, Robert Haas wrote: On Tue, Mar 6, 2012 at 1:59 PM, Tomas Vondra t...@fuzzy.cz wrote: I've noticed a locale-specific bug in regression tests, I discovered thanks to the new magpie buildfarm member (testing

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:14 PM, Simon Riggs si...@2ndquadrant.com wrote: The stored procedure route sounds attractive but its a long way off and doesn't address all of the states needs people have voiced. I'm not against doing both, I just want to do the quickest and easiest. sure, I get that,

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Tom Lane
Larry Rosenman l...@lerctr.org writes: On 3/7/2012 12:31 PM, Alvaro Herrera wrote: Also, this isn't limited to CLUSTER; anything that rewrites the table and indexes would benefit. Meaning ALTER TABLE that does a full rewrite, and also VACUUM FULL. +1. I think we should update ps_status as

Re: [HACKERS] pgsql_fdw, FDW for PostgreSQL server

2012-03-07 Thread Peter Eisentraut
On tis, 2012-03-06 at 13:39 -0500, Tom Lane wrote: A bigger issue with postgresql_fdw_validator is that it supposes that the core backend is authoritative as to what options libpq supports, which is bad design on its face. It would be much more sensible for dblink to be asking libpq what

Re: [HACKERS] WARNING: concurrent insert in progress within table resource

2012-03-07 Thread Robert Haas
On Mon, Feb 27, 2012 at 10:54 AM, Pavel Stehule pavel.steh...@gmail.com wrote: yes 2012/2/27 Robert Haas robertmh...@gmail.com: On Sun, Feb 26, 2012 at 10:04 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello I tested creating some larger indexes There was a warning: postgres=#

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Peter Eisentraut
On lör, 2012-02-25 at 18:03 +0100, Jean-Baptiste Quenot wrote: IMO raising an error is much better because: 1) It is not a valid usecase to retrieve result metadata when no rows are expected to be returned Which led me to think, how are you actually expected to know when no rows are expected

Re: [HACKERS] CLUSTER VERBOSE (9.1.3)

2012-03-07 Thread Larry Rosenman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/7/2012 2:42 PM, Tom Lane wrote: Larry Rosenman l...@lerctr.org writes: On 3/7/2012 12:31 PM, Alvaro Herrera wrote: Also, this isn't limited to CLUSTER; anything that rewrites the table and indexes would benefit. Meaning ALTER TABLE that

Re: [HACKERS] Checksums, state of play

2012-03-07 Thread Bruce Momjian
On Wed, Mar 07, 2012 at 03:33:34PM -0500, Robert Haas wrote: On Wed, Mar 7, 2012 at 3:09 PM, Simon Riggs si...@2ndquadrant.com wrote: Neither do I. It's pretty clear from our last discussion that the fix proposed doesn't actually work fully so I don't think its going to be either more

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On lör, 2012-02-25 at 18:03 +0100, Jean-Baptiste Quenot wrote: IMO raising an error is much better because: 1) It is not a valid usecase to retrieve result metadata when no rows are expected to be returned Which led me to think, how are you actually

Re: [HACKERS] patch for a locale-specific bug in regression tests (REL9_1_STABLE)

2012-03-07 Thread Tomas Vondra
On 7.3.2012 21:39, Robert Haas wrote: On Wed, Mar 7, 2012 at 3:08 PM, Tomas Vondra t...@fuzzy.cz wrote: On 7.3.2012 17:56, Robert Haas wrote: On Tue, Mar 6, 2012 at 1:59 PM, Tomas Vondra t...@fuzzy.cz wrote: I've noticed a locale-specific bug in regression tests, I discovered thanks to the

Re: [HACKERS] NULL's support in SP-GiST

2012-03-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I guess the question is whether this is a stop-ship item for spgist. If it is, then we're going to have to spend the time to fix this, but if not, then since it was submitted more than two weeks after the start of the CommitFest, it seems we should

Re: [HACKERS] elegant and effective way for running jobs inside a database

2012-03-07 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: sure, I get that, especially in regards to procedures. a server ticker though is a pretty small thing and it's fair to ask if maybe that should be exposed instead of (or perhaps in addition to) a job scheduling system. I don't want to have a

Re: [HACKERS] a slightly stale comment

2012-03-07 Thread Dan Ports
On Wed, Mar 07, 2012 at 07:46:32AM +, Simon Riggs wrote: There is much wisdom there and much wisdom in leaving ancient warnings as we find them. The comment is a wise and insightful statement -- about a totally different system than we have today. Are these the words you object to? we

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Well, I guess I'm still of the opinion that the real question is whether the particular lint checks that Pavel's implemented are good and useful things. Has anyone spent any time looking at *that*? I'm not going to stand here and hold my breath over

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
Hello 2012/3/7 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: Just to be clear, I am not proposing that we get rid of CHECK TRIGGER and keep CHECK FUNCTION.  I'm proposing that we get rid of all of the dedicated syntax support, and expose it all through one or more

Re: [HACKERS] WARNING: concurrent insert in progress within table resource

2012-03-07 Thread Pavel Stehule
2012/3/7 Robert Haas robertmh...@gmail.com: On Mon, Feb 27, 2012 at 10:54 AM, Pavel Stehule pavel.steh...@gmail.com wrote: yes 2012/2/27 Robert Haas robertmh...@gmail.com: On Sun, Feb 26, 2012 at 10:04 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello I tested creating some larger

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Peter Eisentraut
On ons, 2012-03-07 at 15:59 -0500, Tom Lane wrote: Which led me to think, how are you actually expected to know when no rows are expected to be returned, in PL/Python? You can look at result.status(), which returns a numeric SPI status, but that seems fragile. I notice that

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On ons, 2012-03-07 at 15:59 -0500, Tom Lane wrote: Or are we talking about two different things? I think so. I'm wondering here how to detect whether the execution of a statement has yielded a result set at all. (For example, you ran SELECT or

Re: [HACKERS] Command Triggers, patch v11

2012-03-07 Thread Thom Brown
On 6 March 2012 23:25, Thom Brown t...@linux.com wrote: On 6 March 2012 21:18, Thom Brown t...@linux.com wrote: On 6 March 2012 21:04, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: [CASCADE will not run the command triggers for cascaded objects] If these are all expected, does it in any way

Re: [HACKERS] WIP: URI connection string support for libpq

2012-03-07 Thread Alexander Shulgin
On 03/07/2012 09:16 PM, Alexander Shulgin wrote: I would prefer src/interfaces/libpq/test, to keep it close to the code. Hm, actually that makes more sense and is not unprecedented (I see ecpg has it's own 'test' subdir.) Apparently I was under false impression that all regression tests are

Re: [HACKERS] psql COPY vs. ON_ERROR_ROLLBACK, multi-command strings

2012-03-07 Thread Robert Haas
On Sat, Feb 25, 2012 at 12:57 AM, Noah Misch n...@leadboat.com wrote: Thanks.  While testing a crashing function, I noticed that my above patch added some noise to psql output when the server crashes: [local] test=# select crashme(); The connection to the server was lost. Attempting reset:

Re: [HACKERS] NULL's support in SP-GiST

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 4:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I guess the question is whether this is a stop-ship item for spgist. If it is, then we're going to have to spend the time to fix this, but if not, then since it was submitted more than

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Peter Eisentraut
On ons, 2012-03-07 at 16:49 -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On ons, 2012-03-07 at 15:59 -0500, Tom Lane wrote: Or are we talking about two different things? I think so. I'm wondering here how to detect whether the execution of a statement has yielded a

Re: [HACKERS] Fix PL/Python metadata when there is no result

2012-03-07 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On ons, 2012-03-07 at 16:49 -0500, Tom Lane wrote: Still, it seems rather arbitrary to say that the row count property is the thing to test for that purpose and no other is. Why not return None for any property that's not sensible? Hmm, above you

Re: [HACKERS] patch for a locale-specific bug in regression tests (REL9_1_STABLE)

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 4:02 PM, Tomas Vondra t...@fuzzy.cz wrote: Ok, so here's a fixed patch. I haven't used the 3e9a2672 commit directly, because there seem to be additional changes. I've simply renamed the 'sc' to 's0' and fixed the differences in output. Thanks, committed. -- Robert Haas

Re: [HACKERS] RFC: Making TRUNCATE more MVCC-safe

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 8:21 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 2:06 PM, Simon Riggs si...@2ndquadrant.com wrote: I am not thrilled with the design as it stands, but bulk loading is a known and serious pain point for us, so it would be awfully nice to improve

Re: [HACKERS] pgsql_fdw, FDW for PostgreSQL server

2012-03-07 Thread Tom Lane
Shigeru Hanada shigeru.han...@gmail.com writes: Agreed. Attached fdw_helper patch doesn't contain GetFdwOptionValue() any more, and pgsql_fdw patch accesses only necessary catalogs. I've committed the fdw_helper part of this, with some very minor improvements. regards,

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-07 Thread Tom Lane
Alexander Korotkov aekorot...@gmail.com writes: On Mon, Mar 5, 2012 at 1:11 AM, Tom Lane t...@sss.pgh.pa.us wrote: Couldn't we reduce the histogram size when there aren't many different counts? It seems fairly obvious to me that we could bound the histogram size with (max count - min count

[HACKERS] Custom Operators Cannot be Found for Composite Type Values

2012-03-07 Thread David E. Wheeler
Hackers, I’m doing some development with the new JSON type (actually, Andrew’s backport to 9.1) and needed to do some very basic equivalence testing. So I created a custom operator: CREATE OR REPLACE FUNCTION json_eq( json, json ) RETURNS BOOLEAN LANGUAGE SQL STRICT

[HACKERS] pg_basebackup streaming issue from standby

2012-03-07 Thread Thom Brown
Hi, I've just tried using pg_basebackup to take a backup of a standby with -x stream but it never finishes. This is what I get: thom@swift:~/Development$ pg_basebackup -p 5489 -D data3 -x stream -Pv xlog start point: 0/620 pg_basebackup: starting background WAL receiver 78020/78020 kB

Re: [HACKERS] pg_basebackup streaming issue from standby

2012-03-07 Thread Fujii Masao
On Thu, Mar 8, 2012 at 10:36 AM, Thom Brown t...@linux.com wrote: I've just tried using pg_basebackup to take a backup of a standby with -x stream but it never finishes. Thanks for the report! This is the same problem as I reported before. We are now discussing how to fix that.

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Thu, Mar 8, 2012 at 12:39 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 6:45 AM, Fujii Masao masao.fu...@gmail.com wrote: pg_stat_statements is basically very helpful to find out slow queries. But since it doesn't report the time spent in the planner, we cannot find

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Thu, Mar 8, 2012 at 1:07 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-07 Thread Tom Lane
I wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: the attached patch improves the array selectivity estimation for = ANY and ALL, hence for the IN/NOT IN operators, to avoid the shortcoming described in http://archives.postgresql.org/pgsql-performance/2012-03/msg6.php. I've

Re: [HACKERS] Custom Operators Cannot be Found for Composite Type Values

2012-03-07 Thread Tom Lane
David E. Wheeler da...@justatheory.com writes: I’m doing some development with the new JSON type (actually, Andrew’s backport to 9.1) and needed to do some very basic equivalence testing. So I created a custom operator: CREATE OR REPLACE FUNCTION json_eq( json, json

Re: [HACKERS] pg_upgrade --logfile option documentation

2012-03-07 Thread Bruce Momjian
On Thu, Mar 01, 2012 at 09:06:10PM -0500, Bruce Momjian wrote: OK, combining your and Robert's ideas, how about I have pg_upgrade write the server log to a file, and the pg_dump output to a file (with its stderr), and if pg_upgrade fails, I report the failure and mention those files. If

Re: [HACKERS] Speed dblink using alternate libpq tuple storage

2012-03-07 Thread Kyotaro HORIGUCHI
Hello, #- We expect PQisBusy(), PQconsumeInput()(?) and #- PQgetResult() to exit immediately and we can #- call PQgetResult(), PQskipResult() or #- PQisBusy() after. | 1 - OK (I'm done with the row) |

Re: [HACKERS] poll: CHECK TRIGGER?

2012-03-07 Thread Pavel Stehule
Hello 2012/3/7 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: Just to be clear, I am not proposing that we get rid of CHECK TRIGGER and keep CHECK FUNCTION.  I'm proposing that we get rid of all of the dedicated syntax support, and expose it all through one or more

  1   2   >