[HACKERS] proof concept: do statement parametrization

2010-07-03 Thread Pavel Stehule
Hello I enhanced DO statement syntax to allowing a parameters. Syntax is relative simple: do ([varname] vartype := value, ...) $$ ... $$ It allows to pass a content of psql variables to inline code block to allows more easy scripting \set schema 'public' do(text := :'schema') $$ declare r reco

Re: [HACKERS] pessimal trivial-update performance

2010-07-03 Thread Robert Haas
On Sun, Jul 4, 2010 at 12:11 AM, Tom Lane wrote: > Robert Haas writes: >> CREATE OR REPLACE FUNCTION update_tab() RETURNS void AS $$ >> BEGIN >>       INSERT INTO tab VALUES (0); >>       FOR i IN 1..10 LOOP >>               UPDATE tab SET x = x + 1; >>       END LOOP; >> END >> $$ LANGUAGE p

Re: [HACKERS] pessimal trivial-update performance

2010-07-03 Thread Tom Lane
Robert Haas writes: > CREATE OR REPLACE FUNCTION update_tab() RETURNS void AS $$ > BEGIN > INSERT INTO tab VALUES (0); > FOR i IN 1..10 LOOP > UPDATE tab SET x = x + 1; > END LOOP; > END > $$ LANGUAGE plpgsql; I believe that none of the dead row versions can be

Re: [HACKERS] Needs Suggestion

2010-07-03 Thread Robert Haas
On Sat, Jul 3, 2010 at 1:04 PM, wrote: > I am currently a student of IIT Bombay of CSE department. I am doing a > project on postgres. I need to understand its code thoroughly, so I need > "ddd" to "step through" its code. I need to start postgres on the > "backend" mode to work it with "ddd".But

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-03 Thread Peter Eisentraut
On lör, 2010-07-03 at 09:26 +0100, Mike Fowler wrote: > What I will do > instead is implement the xml_is_well_formed function and get a patch > out in the next day or two. That sounds very useful. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Needs Suggestion

2010-07-03 Thread Bruce Momjian
sub...@cse.iitb.ac.in wrote: > > Hi, > > I am currently a student of IIT Bombay of CSE department. I am doing a > project on postgres. I need to understand its code thoroughly, so I need > "ddd" to "step through" its code. I need to start postgres on the > "backend" mode to work it with "ddd".But

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-07-03 Thread Nasby, Jim
On Jun 11, 2010, at 5:18 AM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby wrote: >>> So there's no way to see if a particular privilege has been granted to >>> public. ISTM 'public' should be accepted, since you can't use it as a role >>> name anyway... >

[HACKERS] Needs Suggestion

2010-07-03 Thread subham
Hi, I am currently a student of IIT Bombay of CSE department. I am doing a project on postgres. I need to understand its code thoroughly, so I need "ddd" to "step through" its code. I need to start postgres on the "backend" mode to work it with "ddd".But I am facing some difficulties in setting u

[HACKERS] test_fsync output improvement

2010-07-03 Thread Bruce Momjian
I have modified src/tools/test_fsync so its output is operations per second, instead of total seconds, e.g.: Loops = 1 Simple write: 8k write 52549.436/second Compare file sync methods using one write:

Re: [HACKERS] reassign owned to change the ownership for op class and family

2010-07-03 Thread Robert Haas
On Sat, Jul 3, 2010 at 11:47 AM, Tom Lane wrote: > Robert Haas writes: >> http://archives.postgresql.org/pgsql-committers/2010-02/msg00174.php > >> I wonder if we should think about back-patching just the syscache.h >> portion of that patch.  It would simplify back-patching, and might >> make lif

Re: [HACKERS] _bt_parent_deletion_safe() isn't safe

2010-07-03 Thread Alvaro Herrera
Excerpts from Tom Lane's message of vie jul 02 22:02:59 -0400 2010: > Possibly. I was planning to go back and study that code a bit more --- > I have a feeling that there might be some kind of rare concurrency bug > involved in btree page deletion. But I've been up to my rear in > other alligato

Re: [HACKERS] Why are these modules built without respecting my LDFLAGS?

2010-07-03 Thread Tom Lane
Peter Eisentraut writes: > On sön, 2010-06-27 at 19:41 -0400, Tom Lane wrote: >> OK, so after some digging I find that, while most of the .so's in our >> build are made using Makefile.shlib, pgxs's "MODULES" build rules >> don't >> use that. Instead they rely on the "%.so: %.o" (and platform-spe

Re: [HACKERS] Keepalive for max_standby_delay

2010-07-03 Thread Tom Lane
Heikki Linnakangas writes: > On 03/07/10 18:32, Tom Lane wrote: >> That would not do what you want at all in the case where you're >> recovering from archive --- XLogReceiptTime would never advance >> at all for the duration of the recovery. > Do you mean when using something like pg_standby, whi

Re: [HACKERS] Keeping separate WAL segments for each database

2010-07-03 Thread Robert Haas
On Sat, Jul 3, 2010 at 10:46 AM, Simon Riggs wrote: > On Wed, 2010-06-30 at 22:21 -0400, Tom Lane wrote: > >> What about having a single WAL stream for all commit records (thereby >> avoiding any possible xact-serialization funnies) and other WAL >> records >> divided up among multiple streams in

Re: [HACKERS] Keepalive for max_standby_delay

2010-07-03 Thread Heikki Linnakangas
On 03/07/10 18:32, Tom Lane wrote: Heikki Linnakangas writes: It would seem logical to use the same logic for archive recovery as we do for streaming replication, and only set XLogReceiptTime when you have to wait for a WAL segment to arrive into the archive, ie. when restore_command fails. T

Re: [HACKERS] Why is vacuum_defer_cleanup_age PGC_USERSET?

2010-07-03 Thread Simon Riggs
On Sat, 2010-07-03 at 13:07 -0400, Tom Lane wrote: > It seems to me it ought to be PGC_SIGHUP. In the first place, the > actually important value under normal circumstances is going to be > that seen by autovac workers. There is also some impact on HOT > cleanup, but I can't see any sane argument

[HACKERS] Why is vacuum_defer_cleanup_age PGC_USERSET?

2010-07-03 Thread Tom Lane
It seems to me it ought to be PGC_SIGHUP. In the first place, the actually important value under normal circumstances is going to be that seen by autovac workers. There is also some impact on HOT cleanup, but I can't see any sane argument why you don't want all backends to be applying the same va

Re: [HACKERS] reassign owned to change the ownership for op class and family

2010-07-03 Thread Tom Lane
Robert Haas writes: > http://archives.postgresql.org/pgsql-committers/2010-02/msg00174.php > I wonder if we should think about back-patching just the syscache.h > portion of that patch. It would simplify back-patching, and might > make life easier for people trying to write extensions that are >

Re: [HACKERS] Keepalive for max_standby_delay

2010-07-03 Thread Tom Lane
Heikki Linnakangas writes: > It would seem logical to use the same logic for archive recovery as we > do for streaming replication, and only set XLogReceiptTime when you have > to wait for a WAL segment to arrive into the archive, ie. when > restore_command fails. That would not do what you wa

Re: [HACKERS] Keeping separate WAL segments for each database

2010-07-03 Thread Simon Riggs
On Wed, 2010-06-30 at 22:21 -0400, Tom Lane wrote: > What about having a single WAL stream for all commit records (thereby > avoiding any possible xact-serialization funnies) and other WAL > records > divided up among multiple streams in some fashion or other? A commit > record would bear minimum

Re: [HACKERS] nvarchar notation accepted?

2010-07-03 Thread Bruce Momjian
Peter Eisentraut wrote: > On m?n, 2010-06-07 at 12:56 -0500, Jaime Casanova wrote: > > On Mon, Jun 7, 2010 at 2:23 AM, Peter Eisentraut wrote: > > > > > > The N'' syntax is in the SQL standard, > > > > > > > I didn't know that, do you know what paragraph is it? i can't find it > > Look for . I

Re: [HACKERS] reassign owned to change the ownership for op class and family

2010-07-03 Thread Robert Haas
On Thu, Jul 1, 2010 at 11:19 AM, Asko Tiidumaa wrote: > Currently REASSIGN OWNED complains "unexpected classid" for operator > class and family. > > For example, > > create two users, user1 and user2 > > under user1: > create type oxetype as enum ('oxe1'); > create operator class oxeops > default

Re: [HACKERS] Keepalive for max_standby_delay

2010-07-03 Thread Heikki Linnakangas
On 02/07/10 23:36, Tom Lane wrote: Robert Haas writes: I haven't been able to wrap my head around why the delay should be LESS in the archive case than in the streaming case. Can you attempt to hit me with the clue-by-four? In the archive case, you're presumably trying to catch up, and so it

Re: [HACKERS] Keeping separate WAL segments for each database

2010-07-03 Thread Robert Haas
2010/6/30 Tom Lane : > Robert Haas writes: >> You need to make sure not only that you replay commit records in >> order, but also that, for example, you don't replay an >> XLOG_HEAP2_CLEAN record too early. > > Hm, good point.  That probably means that you *do* need fencepost > records, and furthe

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-03 Thread Mike Fowler
Quoting Peter Eisentraut : On fre, 2010-07-02 at 14:07 +0100, Mike Fowler wrote: So if IS CONTENT were to be implemented, to determine that you have something that is malformed But that's not what IS CONTENT does. "Content" still needs to be well-formed. What I was hoping to achieve was t