Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Pavel Stehule
This makes sense now that you've explained it.  Personally, I would not choose to use psql as a scripting language, and I think there has The scripting are not realised directly in psql - psql missing some basic features still. Usually is used in combination with bash (any shell) - like

[HACKERS] keywords on .pgpass

2009-12-25 Thread Fujii Masao
Hi, pg_hba.conf accepts some keywords like 'all', 'sameuser' and so on. Likewise, I'd like to support the same keywords for .pgpass file. Thought? In Streaming Replication, new keyword 'replication' has been introduced into pg_hba.conf to authenticate the standby server. If my proposal will have

Re: [HACKERS] keywords on .pgpass

2009-12-25 Thread Andrew Dunstan
Fujii Masao wrote: Hi, pg_hba.conf accepts some keywords like 'all', 'sameuser' and so on. Likewise, I'd like to support the same keywords for .pgpass file. Thought? I don't see the use case for it - .pgpass is for single users, not a whole cluster. And it does support wildcards,

Re: [HACKERS] Removing pg_migrator limitations

2009-12-25 Thread Bruce Momjian
Bruce Momjian wrote: Bruce Momjian wrote: Well, we might eventually allow addition of values to enums too; the fact that it's not implemented outside pg_migrator right now doesn't mean we won't ever think of a solution. In any case I'm not persuaded that a zero-element enum is

Re: [HACKERS] unicode questions

2009-12-25 Thread - -
On Thu, Dec 24, 2009 at 5:40 PM, Andrew Dunstan and...@dunslane.net wrote: 1) If I set my database and connection encoding to UTF-8, does pg (and future versions of it) guarantee that unicode code points are stored unmodified? or could it be that pg does some unicode normalization/manipulation

[HACKERS] PQescapeByteaConn and the new hex encoding

2009-12-25 Thread Matteo Beccati
Hi everyone, I've been playing with the 8.5alpha3 in the last few days. Among other things, I'm making sure that the pgsql PHP extensions still work correctly with the new version. It would seems so, as all the errors in the standard pgsql extension test suite come from the fact that

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I think maybe what we need here is a piece of syntax to indicate that a specific parameter should be substituted after first being passed through PQescapeStringConn. I agree that a global flag that changes the behavior of :foo is a seriously bad idea.

Re: [HACKERS] Initial refactoring of plperl.c - rebased [PATCH]

2009-12-25 Thread Andrew Dunstan
Tim Bunce wrote: I've attached an update of my previous refactoring of plperl.c. It's been rebased over the current (git) HEAD and has a few very minor additions. [snip] + -- Test compilation of unicode regex + -- + CREATE OR REPLACE FUNCTION perl_unicode_regex(text) RETURNS INTEGER AS

Re: [HACKERS] PQescapeByteaConn and the new hex encoding

2009-12-25 Thread Tom Lane
Matteo Beccati p...@beccati.com writes: However, before taking a look at the actual code and understanding its behaviour, I tried using SET bytea_output = 'escape' and I was expecting PQescapeByteaConn to honour it. Why? PQescapeByteaConn's charter is to produce something that will work on

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: I think maybe what we need here is a piece of syntax to indicate that a specific parameter should be substituted after first being passed through PQescapeStringConn. I agree that a global flag that changes the

Re: [HACKERS] PQescapeByteaConn and the new hex encoding

2009-12-25 Thread Matteo Beccati
Il 25/12/2009 18:54, Tom Lane ha scritto: Matteo Beccatip...@beccati.com writes: However, before taking a look at the actual code and understanding its behaviour, I tried using SET bytea_output = 'escape' and I was expecting PQescapeByteaConn to honour it. Why? PQescapeByteaConn's charter

[HACKERS] proposal for 8.5, listagg aggregate function, WIP patch

2009-12-25 Thread Pavel Stehule
Hello I am returning to discussion http://archives.postgresql.org/pgsql-hackers/2009-12/msg01378.php I propose a new aggregate function - listagg. This function concatenate values to string. If this function is used with two parameters, then second parameter is used as delimiter. NULL input

Re: [HACKERS] PQescapeByteaConn and the new hex encoding

2009-12-25 Thread Andrew Dunstan
Matteo Beccati wrote: Il 25/12/2009 18:54, Tom Lane ha scritto: Matteo Beccatip...@beccati.com writes: However, before taking a look at the actual code and understanding its behaviour, I tried using SET bytea_output = 'escape' and I was expecting PQescapeByteaConn to honour it. Why?

[HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
Hello It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. create aggregate la(text, text) (SFUNC=listagg2_transfn, STYPE=internal, FINALFUNC=listagg_finalfn); postgres=# select la(town,',') from country; la ---

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: there are two quoting styles, so we need two syntax. I proposed :[var] and :{var} - for ident quoting and literal quoting. Theoretically we could to use :(var) for bytea escaping. And if you need a fourth style, you're at a dead end. I don't

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax. Put the aggregate arguments first, then the ORDER BY. regards, tom lane -- Sent via pgsql-hackers mailing

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: there are two quoting styles, so we need two syntax. I proposed :[var] and :{var} - for ident quoting and literal quoting. Theoretically we could to use :(var) for bytea escaping. And if you need a fourth

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first, then the ORDER BY. Sorry, I don't see it. Please,

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Pavel Stehule pavel.steh...@gmail.com: 2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first,

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: It is maybe a bug. I cannot use ORDER BY clause in two parameter aggregate. I think you don't understand the syntax.  Put the aggregate arguments first, then the ORDER BY. I was wrong. But it should be

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Robert Haas
On Fri, Dec 25, 2009 at 1:41 PM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: there are two quoting styles, so we need two syntax. I proposed :[var] and :{var} - for ident quoting and literal quoting. Theoretically we could to use :(var) for bytea escaping.

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: I was wrong. But it should be syntax error no? SELECT foo(expr ORDER BY expr, .) currently it quietly ignore arguments over ORDER BY clause. No, because you could have more than one ORDER BY item. regards, tom lane

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Pavel Stehule
2009/12/25 Robert Haas robertmh...@gmail.com: On Fri, Dec 25, 2009 at 1:41 PM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: there are two quoting styles, so we need two syntax. I proposed :[var] and :{var} - for ident quoting and literal quoting.

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: If we do want to go with a single flag character, maybe it should just be a single or double quote: :'foo - quote as a literal :foo - quote as an ident I would've proposed that myself if I thought it would work, but I'm afraid that it will wreak

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I was wrong. But it should be syntax error no? SELECT foo(expr ORDER BY expr, .) currently it quietly ignore arguments over ORDER BY clause. No, because you could have more than one ORDER BY item. I

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: If we do want to go with a single flag character, maybe it should just be a single or double quote: :'foo - quote as a literal :foo - quote as an ident I would've proposed that myself if I thought it would

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Robert Haas
On Fri, Dec 25, 2009 at 2:12 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: If we do want to go with a single flag character, maybe it should just be a single or double quote: :'foo - quote as a literal :foo - quote as an ident I would've proposed that

Re: [HACKERS] ORDER BY clause in aggregate doesn't work well with multi argument aggregates

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2009/12/25 Tom Lane t...@sss.pgh.pa.us: No, because you could have more than one ORDER BY item. hmm - this isn't bullet-prof design :( I notice that ORDER BY 'x' draws an error at the query level but not within aggregates or window functions. I

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Works for me. One small problem discussed upthread is that there currently doesn't appear to be a libpq function that does ident-quoting. I'm thinking that we will need to add one to make this work - is that going to be a problem? The rules for

[HACKERS] Reg postgresSQL source code

2009-12-25 Thread Manan Nayak
Dear Sir, I am a 3rd year B.Tech. (Computer Science Engineering) student at IIIT, Hyderabad (India). For the past 5 months I've been trying to implement a module in postgresSQL and I am stuck at a point. I'll be highly grateful to you if you could help me out. The module is about constructing a

[HACKERS] PostgreSQL 8.5 Open Items

2009-12-25 Thread Robert Haas
I'm not sure whether we ever posted this schedule anywhere official - if so, I can't find it - but my understanding is that we have consensus on the release schedule described here: http://archives.postgresql.org/pgsql-hackers/2009-09/msg01251.php Under this schedule, the last CommitFest for the

Re: [HACKERS] info about patch: using parametrised query in psql

2009-12-25 Thread Robert Haas
On Fri, Dec 25, 2009 at 2:30 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Works for me.  One small problem discussed upthread is that there currently doesn't appear to be a libpq function that does ident-quoting.  I'm thinking that we will need to add one to

Re: [HACKERS] Initial refactoring of plperl.c - rebased [PATCH]

2009-12-25 Thread Tim Bunce
On Fri, Dec 25, 2009 at 12:54:13PM -0500, Andrew Dunstan wrote: Tim Bunce wrote: I've attached an update of my previous refactoring of plperl.c. It's been rebased over the current (git) HEAD and has a few very minor additions. [snip] + -- Test compilation of unicode regex + -- + CREATE

Re: [HACKERS] Update ppport.h in plperl

2009-12-25 Thread Tim Bunce
On Thu, Dec 24, 2009 at 11:08:49AM -0500, Andrew Dunstan wrote: Tim Bunce wrote: I'm about ready to post the next draft of my plperl feature patch. When I looked at the diff I saw ~7800 lines of it were just due to updating ppport.h. So I've broken that out into this large but totally

Re: [HACKERS] Initial refactoring of plperl.c - rebased [PATCH]

2009-12-25 Thread Andrew Dunstan
Tim Bunce wrote: On Fri, Dec 25, 2009 at 12:54:13PM -0500, Andrew Dunstan wrote: Tim Bunce wrote: I've attached an update of my previous refactoring of plperl.c. It's been rebased over the current (git) HEAD and has a few very minor additions. [snip] + -- Test

Re: [HACKERS] creating index names automatically?

2009-12-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Having said all this, I don't really object to the alternate proposal of creating a set of words that are reserved as relation names but not as column names, either, especially if it would allow us to make some other existing keywords less-reserved.

[HACKERS] PHP and PostgreSQL 8.5 compatibility

2009-12-25 Thread Matteo Beccati
Hi everyone, I'm glad to announce that the pgsql and PDO PHP extensions test suites are now passing when used with 8.5-cvs. Mostly it was just a matter of updating the tests themselves, but a bug in PDO_PgSQL dealing with the new hex format affecting only the 5.2.x branch was fixed during the

Re: [HACKERS] proposal for 8.5, listagg aggregate function, WIP patch

2009-12-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: I propose a new aggregate function - listagg. This function concatenate values to string. If this function is used with two parameters, then second parameter is used as delimiter. NULL input values are ignored like other aggregates. If all values

Re: [HACKERS] proposal for 8.5, listagg aggregate function, WIP patch

2009-12-25 Thread Pavel Stehule
2009/12/25 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: I propose a new aggregate function - listagg. This function concatenate values to string. If this function is used with two parameters, then second parameter is used as delimiter. NULL input values are

Re: [HACKERS] creating index names automatically?

2009-12-25 Thread Robert Haas
On Fri, Dec 25, 2009 at 4:13 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Having said all this, I don't really object to the alternate proposal of creating a set of words that are reserved as relation names but not as column names, either, especially if it

Re: [HACKERS] keywords on .pgpass

2009-12-25 Thread Fujii Masao
On Fri, Dec 25, 2009 at 9:56 PM, Andrew Dunstan and...@dunslane.net wrote: I don't see the use case for it - .pgpass is for single users, not a whole cluster. And it does support wildcards, which takes care of the 'all' case. In the case of pg_hba.conf we don't know in advance who will actually

Re: [HACKERS] creating index names automatically?

2009-12-25 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Dec 25, 2009 at 05:27:44PM -0500, Robert Haas wrote: On Fri, Dec 25, 2009 at 4:13 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: [...] I think what we should learn from this case, as well as the recent