Implemented current_query

Lists: pgsql-hackerspgsql-patches
From: Tomas Doran <bobtfish(at)bobtfish(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Subject: Implemented current_query
Date: 2007-05-07 18:48:25
Message-ID: 95BC6EB1-1CC5-44C9-90B7-73512F209228@bobtfish.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

As suggested in the TODO list (and as I need the functionality
myself), I have implemented the current_query interface to
debug_query_string.

I'm not sure the best place to put this, suggestions welcome..

Please review the patch attached.

Cheers
Tom

Attachment Content-Type Size
pgsql-current_query.patch application/octet-stream 5.4 KB

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tomas Doran <bobtfish(at)bobtfish(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2007-05-07 22:25:19
Message-ID: 1178576719.6034.9.camel@goldbach
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Mon, 2007-07-05 at 19:48 +0100, Tomas Doran wrote:
> As suggested in the TODO list (and as I need the functionality
> myself), I have implemented the current_query interface to
> debug_query_string.

Comments:

* docs need a bit more detail (they should emphasize that it is the
current query string submitted by the client, as opposed to the
currently executing SPI command or the like). Also, the docs currently
claim current_query() returns "name".

* use textin() to convert C-style strings to text, rather than
constructing a text datum by hand

* perhaps we can get away with marking current_query() stable?

* AFAIK debug_query_string() still does the wrong thing when the user
submits multiple queries in a single protocol message (separated by
semi-colons). Not sure there's a way to fix that that is both easy and
efficient, though...

-Neil


From: Tomas Doran <bobtfish(at)bobtfish(dot)net>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2007-05-10 01:59:56
Message-ID: 3067A7EE-6A37-47A2-BAF2-B27B63EE0B57@bobtfish.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


On 7 May 2007, at 23:25, Neil Conway wrote:

> On Mon, 2007-07-05 at 19:48 +0100, Tomas Doran wrote:
>> As suggested in the TODO list (and as I need the functionality
>> myself), I have implemented the current_query interface to
>> debug_query_string.
>
> * docs need a bit more detail (they should emphasize that it is the

Detail added. I'm none too happy with the phrasing, anyone suggest
better?

> * use textin() to convert C-style strings to text, rather than
> constructing a text datum by hand

Done.

> * perhaps we can get away with marking current_query() stable?

Also done, note OID has changed as I was having conflicts (template1
wouldn't build). Should I either pick something else unused which is
lower (is there anything?), move current_query to the end of the file
or just leave it be..

> * AFAIK debug_query_string() still does the wrong thing when the user
> submits multiple queries in a single protocol message (separated by
> semi-colons). Not sure there's a way to fix that that is both easy and
> efficient, though...

Should that be added to the TODO list?

Cheers
Tom

Attachment Content-Type Size
pgsql-current_query_2.patch application/octet-stream 11.3 KB

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tomas Doran <bobtfish(at)bobtfish(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2007-05-10 02:09:53
Message-ID: 20070510020953.GC4504@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tomas Doran wrote:
>
> On 7 May 2007, at 23:25, Neil Conway wrote:
>
> >On Mon, 2007-07-05 at 19:48 +0100, Tomas Doran wrote:
> >>As suggested in the TODO list (and as I need the functionality
> >>myself), I have implemented the current_query interface to
> >>debug_query_string.

FWIW I think you should still provide dblink_current_query, even if it's
only a wrapper over current_query(), for backwards compatibility.

Also, typically we don't remove items from the TODO list. We mark them
as "done" prepending them with a dash. Patch authors are not expected
to do it either (though I don't see it be a problem if they did).

> Also done, note OID has changed as I was having conflicts (template1
> wouldn't build). Should I either pick something else unused which is
> lower (is there anything?), move current_query to the end of the file
> or just leave it be..

Doesn't matter ... just make sure duplicate_oids doesn't report a
problem. unused_oids is useful to find, err, unused OIDs.

> >* AFAIK debug_query_string() still does the wrong thing when the user
> >submits multiple queries in a single protocol message (separated by
> >semi-colons). Not sure there's a way to fix that that is both easy and
> >efficient, though...
>
> Should that be added to the TODO list?

Probably ...

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Tomas Doran <bobtfish(at)bobtfish(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2007-05-12 02:16:03
Message-ID: F76AB90C-259D-4C2E-9AFE-0D8E8A26847D@bobtfish.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


On 10 May 2007, at 03:09, Alvaro Herrera wrote:
> FWIW I think you should still provide dblink_current_query, even if
> it's
> only a wrapper over current_query(), for backwards compatibility.

Good point. Done as suggested (I think, or did you mean also the
change of instances to use current_query()?). Replaced
dblink_current_query with an SQL procedure wrapper, I assume that's
the most efficient way of doing it?

> Also, typically we don't remove items from the TODO list. We mark
> them
> as "done" prepending them with a dash. Patch authors are not expected
> to do it either (though I don't see it be a problem if they did).

Not quite sure what you're suggesting (which way round), so I just
didn't do it (as you said I'm not expected to).

> Doesn't matter ... just make sure duplicate_oids doesn't report a
> problem. unused_oids is useful to find, err, unused OIDs.

Ahh, hadn't found those, thanks. They're in the dev FAQ too, *blush*.
I need this for something I'm doing at $ork, and thought I'd
implement it in the backend, as well as a .so, it's been a learning
experience :)

>>> * AFAIK debug_query_string() still does the wrong thing when the
>>> user
>>
>> Should that be added to the TODO list?
>
> Probably ...

Done!

Cheers
Tom

Attachment Content-Type Size
pgsql-current_query.patch application/octet-stream 11.4 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tomas Doran <bobtfish(at)bobtfish(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2007-05-17 01:07:31
Message-ID: 200705170107.l4H17V805764@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Tomas Doran wrote:
>
> On 10 May 2007, at 03:09, Alvaro Herrera wrote:
> > FWIW I think you should still provide dblink_current_query, even if
> > it's
> > only a wrapper over current_query(), for backwards compatibility.
>
> Good point. Done as suggested (I think, or did you mean also the
> change of instances to use current_query()?). Replaced
> dblink_current_query with an SQL procedure wrapper, I assume that's
> the most efficient way of doing it?
>
> > Also, typically we don't remove items from the TODO list. We mark
> > them
> > as "done" prepending them with a dash. Patch authors are not expected
> > to do it either (though I don't see it be a problem if they did).
>
> Not quite sure what you're suggesting (which way round), so I just
> didn't do it (as you said I'm not expected to).
>
> > Doesn't matter ... just make sure duplicate_oids doesn't report a
> > problem. unused_oids is useful to find, err, unused OIDs.
>
> Ahh, hadn't found those, thanks. They're in the dev FAQ too, *blush*.
> I need this for something I'm doing at $ork, and thought I'd
> implement it in the backend, as well as a .so, it's been a learning
> experience :)
>
> >>> * AFAIK debug_query_string() still does the wrong thing when the
> >>> user
> >>
> >> Should that be added to the TODO list?
> >
> > Probably ...
>
> Done!
>
> Cheers
> Tom
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Tomas Doran <bobtfish(at)bobtfish(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 17:23:09
Message-ID: 200803281723.m2SHN9320702@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Neil Conway wrote:
> On Mon, 2007-07-05 at 19:48 +0100, Tomas Doran wrote:
> > As suggested in the TODO list (and as I need the functionality
> > myself), I have implemented the current_query interface to
> > debug_query_string.

It actually has been removed from the TODO list since you saw it last.

> Comments:
>
...
> * AFAIK debug_query_string() still does the wrong thing when the user
> submits multiple queries in a single protocol message (separated by
> semi-colons). Not sure there's a way to fix that that is both easy and
> efficient, though...

The problem with the last bullet is pretty serious. It can be
illustrated with psql:

$ psql -c 'set log_statement="all";select 1;select 2;' test

Server log shows:

STATEMENT: set log_statement=all;select 1;select 2;

Obviously this is what current_query() would return if we commit this
patch, and it probably isn't 100% accurate. I see dblink exposes this:

http://www.postgresql.org/docs/8.3/static/contrib-dblink-current-query.html

Returns the currently executing interactive command string of the
local database session, or NULL if it can't be determined. Note
that this function is not really related to <filename>dblink</>'s
other functionality. It is provided since it is sometimes useful
in generating queries to be forwarded to remote databases.

but making it more widely available with a possible inaccurate result is
a problem. We can't think of anyway to fix this cleanly --- it would
require a separate parser pass to split queries by semicolons (which
psql does by default in interactive mode). Right now the parser does
the splitting as part of its normal single-parse operation and just
creates parse trees that don't have string representations.

Perhaps we could name it received_query() to indicate it is what the
backend received and it not necessarily the _current_ query.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tomas Doran <bobtfish(at)bobtfish(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 17:58:33
Message-ID: 31E3BCC5-C720-4ACB-A93F-32E708C83B8B@bobtfish.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


On 28 Mar 2008, at 17:23, Bruce Momjian wrote:
> Neil Conway wrote:
>> On Mon, 2007-07-05 at 19:48 +0100, Tomas Doran wrote:
>>> As suggested in the TODO list (and as I need the functionality
>>> myself), I have implemented the current_query interface to
>>> debug_query_string.
>
> It actually has been removed from the TODO list since you saw it last.

I submitted a patch to make it do that a while ago :)

>> Comments:
>>
> ...
>> * AFAIK debug_query_string() still does the wrong thing when the user
>> submits multiple queries in a single protocol message (separated by
>> semi-colons). Not sure there's a way to fix that that is both easy
>> and
>> efficient, though...
>
> The problem with the last bullet is pretty serious. It can be
> illustrated with psql:
>
> $ psql -c 'set log_statement="all";select 1;select 2;' test
>
> Server log shows:
>
> STATEMENT: set log_statement=all;select 1;select 2;
>
> Obviously this is what current_query() would return if we commit this
> patch, and it probably isn't 100% accurate.

Yeah, this was pointed out to me at the time.

Fortunately, for what I wanted to do, 'Don't do that then' was a very
viable answer..

> I see dblink exposes this:
>
> http://www.postgresql.org/docs/8.3/static/contrib-dblink-
> current-query.html
>
> Returns the currently executing interactive command string of the
> local database session, or NULL if it can't be determined. Note
> that this function is not really related to <filename>dblink</>'s
> other functionality. It is provided since it is sometimes useful
> in generating queries to be forwarded to remote databases.

My patch provided this functionality in core, and made dblink's
current procedure to do the same just delegate to the one that I
provided (for backwards compatibility reasons)

> but making it more widely available with a possible inaccurate
> result is
> a problem. We can't think of anyway to fix this cleanly --- it would
> require a separate parser pass to split queries by semicolons (which
> psql does by default in interactive mode). Right now the parser does
> the splitting as part of its normal single-parse operation and just
> creates parse trees that don't have string representations.
>
> Perhaps we could name it received_query() to indicate it is what the
> backend received and it not necessarily the _current_ query.

reveived_query() sounds like a very sane name for me, and documenting
it as such would allow you to expose the functionality without the
possible complaints...

In a lot of environments where you actually want this, then
constraining to 1 query per statement (outside the DB level) is very
doable... I wouldn't like to see the functionality skipped over as
providing this only solves 80% of cases.

In the particular application that I wrote the patch for, we needed
to audit 'all access to encrypted credit card numbers' for PCI
requirements..

Our solution was to put all cc number containing tables into their
own schema / with no general permissions, and to use SECURITY DEFINER
stored procedures to access them (and log the access).. However that
wasn't quite good enough, so we got our DB access layer to iterate up
the call stack (till outside our SQL abstraction), and add a comment
to every query such that it took the form:

/* CodeFile-LineNo-UserId */ SELECT stored_procedure(arg1, arg2);

for all queries - so the caller information was encoded in the query
info... Therefore, inside 'stored_procedure', logging the value of
current_query() was perfect to satisfy our audit requirements, and we
can just log the current query when we enter 'stored_procedure'.

Hope this helps to clarify that, whilst the current mechanism isn't
in any way perfect - there are a number of use cases for including
the functionality as-is.

Cheers
Tom

Cheers
Tom


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tomas Doran <bobtfish(at)bobtfish(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 18:21:15
Message-ID: 20080328182115.GU7464@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tomas Doran wrote:

> On 28 Mar 2008, at 17:23, Bruce Momjian wrote:

>> Perhaps we could name it received_query() to indicate it is what the
>> backend received and it not necessarily the _current_ query.
>
> reveived_query() sounds like a very sane name for me, and documenting it
> as such would allow you to expose the functionality without the possible
> complaints...

client_query perhaps?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tomas Doran <bobtfish(at)bobtfish(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 18:32:27
Message-ID: 200803281832.m2SIWRC12243@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera wrote:
> Tomas Doran wrote:
>
> > On 28 Mar 2008, at 17:23, Bruce Momjian wrote:
>
> >> Perhaps we could name it received_query() to indicate it is what the
> >> backend received and it not necessarily the _current_ query.
> >
> > reveived_query() sounds like a very sane name for me, and documenting it
> > as such would allow you to expose the functionality without the possible
> > complaints...
>
> client_query perhaps?

Yea, that is consistent with what we do with other functions.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tomas Doran <bobtfish(at)bobtfish(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 19:09:59
Message-ID: 1206731399.4285.1781.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Fri, 2008-03-28 at 14:32 -0400, Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Tomas Doran wrote:
> >
> > > On 28 Mar 2008, at 17:23, Bruce Momjian wrote:
> >
> > >> Perhaps we could name it received_query() to indicate it is what the
> > >> backend received and it not necessarily the _current_ query.
> > >
> > > reveived_query() sounds like a very sane name for me, and documenting it
> > > as such would allow you to expose the functionality without the possible
> > > complaints...
> >
> > client_query perhaps?
>
> Yea, that is consistent with what we do with other functions.

How about client_request()

It's then clear that a request can be made up of many statements, which
will be executed in turn.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tomas Doran <bobtfish(at)bobtfish(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-28 20:26:42
Message-ID: 200803282026.m2SKQg020431@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Simon Riggs wrote:
> On Fri, 2008-03-28 at 14:32 -0400, Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> > > Tomas Doran wrote:
> > >
> > > > On 28 Mar 2008, at 17:23, Bruce Momjian wrote:
> > >
> > > >> Perhaps we could name it received_query() to indicate it is what the
> > > >> backend received and it not necessarily the _current_ query.
> > > >
> > > > reveived_query() sounds like a very sane name for me, and documenting it
> > > > as such would allow you to expose the functionality without the possible
> > > > complaints...
> > >
> > > client_query perhaps?
> >
> > Yea, that is consistent with what we do with other functions.
>
> How about client_request()
>
> It's then clear that a request can be made up of many statements, which
> will be executed in turn.

The problem with client_request() is that it is not clear it is a query
--- it could be a disonnection or cancel request, for example.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tomas Doran <bobtfish(at)bobtfish(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-29 12:03:20
Message-ID: 200803291203.m2TC3KK07120@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Tomas Doran wrote:
> >
> > > On 28 Mar 2008, at 17:23, Bruce Momjian wrote:
> >
> > >> Perhaps we could name it received_query() to indicate it is what the
> > >> backend received and it not necessarily the _current_ query.
> > >
> > > reveived_query() sounds like a very sane name for me, and documenting it
> > > as such would allow you to expose the functionality without the possible
> > > complaints...
> >
> > client_query perhaps?
>
> Yea, that is consistent with what we do with other functions.

Uh, I think based on other usage it should be called client_statement().
Peter has us using statement instead of query in many cases.

FYI, log_statement also prints the combined query string.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tomas Doran <bobtfish(at)bobtfish(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Implemented current_query
Date: 2008-03-29 16:19:53
Message-ID: 8823.1206807593@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Uh, I think based on other usage it should be called client_statement().

That is *exactly* the wrong thing, because "statement" specifically
means one SQL statement.

"client_query" seems about the best compromise I've heard so far.

It's too bad we didn't have this debate before pg_stat_activity got out
into the wild, because it's now too late to rename its column
current_query. Possibly we should stick with current_query() just
for consistency with that view ...

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tomas Doran <bobtfish(at)bobtfish(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implemented current_query
Date: 2008-04-04 17:00:55
Message-ID: 200804041700.m34H0tu18740@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


I have applied a modified version of this patch, attached. I made a few
changes:

o You had current_query() returning 'void' so it didn't work
o I removed the dblink regression tests for current_query() as
it is now a backend function
o Update documentation to mention the possibility of multiple
statements
o Used the new cstring_to_text() usage that Tom had updated in
CVS for this function
o The pg_proc.h oids and number of columns didn't match CVS

Thanks for the patch.

---------------------------------------------------------------------------

Tomas Doran wrote:
>
> On 10 May 2007, at 03:09, Alvaro Herrera wrote:
> > FWIW I think you should still provide dblink_current_query, even if
> > it's
> > only a wrapper over current_query(), for backwards compatibility.
>
> Good point. Done as suggested (I think, or did you mean also the
> change of instances to use current_query()?). Replaced
> dblink_current_query with an SQL procedure wrapper, I assume that's
> the most efficient way of doing it?
>
> > Also, typically we don't remove items from the TODO list. We mark
> > them
> > as "done" prepending them with a dash. Patch authors are not expected
> > to do it either (though I don't see it be a problem if they did).
>
> Not quite sure what you're suggesting (which way round), so I just
> didn't do it (as you said I'm not expected to).
>
> > Doesn't matter ... just make sure duplicate_oids doesn't report a
> > problem. unused_oids is useful to find, err, unused OIDs.
>
> Ahh, hadn't found those, thanks. They're in the dev FAQ too, *blush*.
> I need this for something I'm doing at $ork, and thought I'd
> implement it in the backend, as well as a .so, it's been a learning
> experience :)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 9.4 KB