Re: [HACKERS] [PATCH] Add a test for pg_get_functiondef()

2009-04-13 Thread Abhijit Menon-Sen
Sorry, I screwed up a little in sending that patch. Here it is again as an attachment. -- ams diff --git a/src/test/regress/sql/defs.sql b/src/test/regress/sql/defs.sql new file mode 100644 index 000..cf8fff3 --- /dev/null +++ b/src/test/regress/sql/defs.sql @@ -0,0 +1,24 @@ +-- Test

Re: [HACKERS] Solution of the file name problem of copy on windows.

2009-04-13 Thread Itagaki Takahiro
Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp wrote: Hiroshi Saito z-sa...@guitar.ocn.ne.jp wrote: Um, I had a focus in help the problem which is not avoided. I am not sensitive to a problem being avoided depending on usage. However, I will wish to work spontaneously, when it is

Re: [HACKERS] New trigger option of pg_standby

2009-04-13 Thread Guillaume Smet
On Mon, Apr 13, 2009 at 7:52 AM, Fujii Masao masao.fu...@gmail.com wrote: 1. the trigger file containing smart is created. 2. pg_standby is executed. 2-1. nextWALfile is restored. 2-2. the trigger file is deleted because nextWALfile+1 doesn't exist. 3. the restored nextWALfile is

Re: [HACKERS] New trigger option of pg_standby

2009-04-13 Thread Fujii Masao
Hi, On Mon, Apr 13, 2009 at 7:21 PM, Guillaume Smet guillaume.s...@gmail.com wrote: On Mon, Apr 13, 2009 at 7:52 AM, Fujii Masao masao.fu...@gmail.com wrote: 1. the trigger file containing smart is created. 2. pg_standby is executed.    2-1. nextWALfile is restored.    2-2. the trigger file

Re: [HACKERS] Solution of the file name problem of copy on windows.

2009-04-13 Thread Tom Lane
Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp writes: Here is a patch to implement GetPlatformEncoding() and convert absolute file paths from database encoding to platform encoding. This seems like a fairly significant overhead added to solve a really minor problem (if it's not minor why has

Re: [HACKERS] [PATCH] Add a test for pg_get_functiondef()

2009-04-13 Thread Tom Lane
Abhijit Menon-Sen a...@oryx.com writes: [ a test whose purpose he didn't bother to describe ] What is the value of this? It seems far more likely to cause maintenance pain than to catch anything interesting. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Solution of the file name problem of copy on windows.

2009-04-13 Thread Hiroshi Saito
Hi. Anyhow, I appreciate discussion. - Original Message - From: Tom Lane t...@sss.pgh.pa.us Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp writes: Here is a patch to implement GetPlatformEncoding() and convert absolute file paths from database encoding to platform encoding.

[HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread mito
Hi, is there any way how to count affected rows by on update rule and use it as part of condtions. Example: CREATE OR REPLACE RULE _UPDATE AS ON UPDATE TO users DO INSTEAD ( UPDATE s_users SET id = new.id, login = new.login, WHERE id IN (SELECT id FROM s_users ) AND 2

Re: [HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread Jaime Casanova
On Mon, Apr 13, 2009 at 11:12 AM, mito milos.ors...@gmail.com wrote: It need to simulate unique constraint on field s_users.new_id, so it should deny to update multiple rows with same value. Any suggestions are welcome. why not simply create a UNIQUE constraint? -- Atentamente, Jaime

Re: [HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread Robert Haas
On Mon, Apr 13, 2009 at 12:12 PM, mito milos.ors...@gmail.com wrote: Hi, is there any way how to count affected rows by on update rule and use it as part of condtions. Example: CREATE OR REPLACE RULE _UPDATE AS ON UPDATE TO users DO INSTEAD (   UPDATE s_users SET    id = new.id,        

Re: [HACKERS] New trigger option of pg_standby

2009-04-13 Thread Simon Riggs
On Mon, 2009-04-13 at 14:52 +0900, Fujii Masao wrote: if (triggered) { if (smartMode nextWALfile exists) exit(0) else { delete trigger file exit(1) } } This looks to be the correct one. -- Simon Riggs www.2ndQuadrant.com

Re: [HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread mito
I am using rules as layer to save every version of row in shadow table, so i cant use unique constraint on column, because of many versions may have same value. mito Jaime Casanova wrote: On Mon, Apr 13, 2009 at 11:12 AM, mito milos.ors...@gmail.com wrote: It need to simulate unique

Re: [HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread Robert Haas
On Mon, Apr 13, 2009 at 12:59 PM, mito milos.ors...@gmail.com wrote: I am using rules as layer to save every version of row in shadow table, so i cant use unique constraint on column, because of many versions may have same value. Use a partial index. ...Robert -- Sent via pgsql-hackers

[HACKERS] Unicode support

2009-04-13 Thread - -
Hi. While PostgreSQL is a great database, it lacks some fundamental Unicode support. I want to present some points that have--to my knowledge--not been addressed so far. In the following text, it is assumed that the database and client encoding is UTF-8. 1) Functions like char_length() or

[HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Pavel Stehule
Hello, this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored procedures. These data cannot be modified by user, so implementation doesn't need any new statements. Notes,

Re: [HACKERS] Affected rows count by rule as condtition

2009-04-13 Thread mito
This will deny insert of value that allready exists. Which is ok. But the second scenerio in which unique constraint refuse operation is, when u try to update more rows to same value in column with unique constraint. So i need to use count of affected rows, to deny operation if there are more

Re: [HACKERS] Unicode support

2009-04-13 Thread Kevin Grittner
Alvaro Herrera alvhe...@commandprompt.com wrote: 1) Functions like char_length() or length() do NOT return the number of characters (the manual says they do), instead they return the number of code points. I think you have client_encoding misconfigured. alvherre=# select

Re: [HACKERS] Unicode support

2009-04-13 Thread Andrew Dunstan
Alvaro Herrera wrote: - - wrote: 1) Functions like char_length() or length() do NOT return the number of characters (the manual says they do), instead they return the number of code points. I think you have client_encoding misconfigured. alvherre=# select length('á'::text);

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Robert Haas
On Mon, Apr 13, 2009 at 2:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Jaime Casanova
On Mon, Apr 13, 2009 at 1:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored procedures. These data cannot be

Re: [HACKERS] Unicode support

2009-04-13 Thread Alvaro Herrera
- - wrote: 1) Functions like char_length() or length() do NOT return the number of characters (the manual says they do), instead they return the number of code points. I think you have client_encoding misconfigured. alvherre=# select length('á'::text); length 1 (1 fila)

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Pavel Stehule
2009/4/13 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored procedures. These data cannot

Re: [HACKERS] Regression failure on RHEL 4 w/ PostgreSQL 8.4 beta1

2009-04-13 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= dev...@gunduz.org writes: I'm getting the following failure on RHEL 4: http://www.gunduz.org/temp/regression.out http://www.gunduz.org/temp/regression.diffs This test is checking whether you have working 64-bit-tzdata support. It seems you don't. If you

Re: [HACKERS] Re: [BUGS] BUG #4027: backslash escapingnotdisabledinplpgsql

2009-04-13 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Kevin Grittner kevin.gritt...@wicourts.gov writes: a change to CREATE FUNCTION such that there is an implied SET standard_compliant_strings FROM CURRENT Hopefully obvious, I meant standard_conforming_strings. it seems like a really bad idea. Then

[HACKERS] psql with Function Type in \df

2009-04-13 Thread David Fetter
Folks, Here's a patch that adds a Function Type column to \df while removing the now-redundant \da. Cheers, David. -- David Fetter da...@fetter.org http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote!

Re: [HACKERS] Unicode support

2009-04-13 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: This isn't about the number of bytes, but about whether or not we should count characters encoded as two or more combined code points as a single char or not. It's really about whether we should support non-canonical encodings. AFAIK that's a hack

Re: [HACKERS] Unicode support

2009-04-13 Thread Greg Stark
On Mon, Apr 13, 2009 at 9:15 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Dunstan and...@dunslane.net writes: This isn't about the number of bytes, but about whether or not we should count characters encoded as two or more combined code points as a single char or not. It's really about

Re: [HACKERS] Unicode support

2009-04-13 Thread Tom Lane
Greg Stark st...@enterprisedb.com writes: Is it really true trhat canonical encodings never contain any composed characters in them? I thought there were some glyphs which could only be represented by composed characters. AFAIK that's not true. However, in my original comment I was thinking

Re: [HACKERS] Unicode support

2009-04-13 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: This isn't about the number of bytes, but about whether or not we should count characters encoded as two or more combined code points as a single char or not. It's really about whether we should support non-canonical

Re: [HACKERS] Unicode support

2009-04-13 Thread - -
Tom Lane t...@sss.pgh.pa.us wrote: Greg Stark st...@enterprisedb.com writes: Is it really true trhat canonical encodings never contain any composed characters in them? I thought there were some glyphs which could only be represented by composed characters. AFAIK that's not true. However, in

[HACKERS] Regression failure on RHEL 4 w/ PostgreSQL 8.4 beta1

2009-04-13 Thread Devrim GÜNDÜZ
Hi, I'm getting the following failure on RHEL 4: http://www.gunduz.org/temp/regression.out http://www.gunduz.org/temp/regression.diffs Here is the Makefile.regress that I use while building RPMs on 8.4:

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Kevin Grittner
Pavel Stehule pavel.steh...@gmail.com wrote: Important data are date of creating and date of altering tables and stored procedures. These data cannot be modified by user, so implementation doesn't need any new statements. Notes, objections? This feature has been present in other database

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Pavel Stehule
2009/4/13 Kevin Grittner kevin.gritt...@wicourts.gov: Pavel Stehule pavel.steh...@gmail.com wrote: Important data are date of creating and date of altering tables and stored procedures. These data cannot be modified by user, so implementation doesn't need any new statements. Notes,

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: this my proposal is very simple. It help to people who have to manage large or complex database system. Important data are date of creating and date of altering tables and stored procedures. These data cannot be modified by user, so implementation

[HACKERS] join ordering

2009-04-13 Thread Robert Haas
I have a query that performs poorly which can be simplified to the following test case (v8.3.6). CREATE TABLE foo (id integer, primary key (id)); INSERT INTO foo SELECT generate_series(1,10); CREATE TABLE bar (id integer, foo_id integer not null references foo (id), PRIMARY KEY (id)); INSERT

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Josh Berkus
- what if I need to know about operators, operator classes, schemas, etc etc Fine, let's log this info for those too (or else decide they're too obscure and don't - pg_class and pg_proc are certainly the most interesting cases). I would suggest putting this info in a separate table,

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: I would suggest putting this info in a separate table, pg_change. It would have oid, catalog, user_changed, changed_on. That way we could simply keep the data for all objects which have an OID. That makes more sense to me --- it would easily extend to

Re: [HACKERS] join ordering

2009-04-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: This isn't a very good plan. What we should do is first join the values expression against bar, and then join the resulting rows against foo. The optimizer doesn't want to do that, and I think the reason is because it knows that the left join might

Re: [HACKERS] psql with Function Type in \df

2009-04-13 Thread Tom Lane
David Fetter da...@fetter.org writes: Here's a patch that adds a Function Type column to \df while removing the now-redundant \da. Removing \da altogether was nowhere in the consensus, or even in the discussion AFAIR. Also, what is the point of using single-letter type codes when you've made

Re: [HACKERS] psql with Function Type in \df

2009-04-13 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Here's a patch that adds a Function Type column to \df while removing the now-redundant \da. 1. How does it make it redundant - is there a way to view all aggregates with \df now? 2. Even if the above is satisfied, I think we need a little

Re: [HACKERS] Solution of the file name problem of copy on windows.

2009-04-13 Thread Itagaki Takahiro
Tom Lane t...@sss.pgh.pa.us wrote: Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp writes: Here is a patch to implement GetPlatformEncoding() and convert absolute file paths from database encoding to platform encoding. This seems like a fairly significant overhead added to solve a really

Re: [HACKERS] [GENERAL] Fragments in tsearch2 headline

2009-04-13 Thread Tom Lane
Sushant Sinha sushant...@gmail.com writes: Sorry for the delay. Here is the patch with FragmentDelimiter option. It requires an extra option in HeadlineParsedText and uses that option during generateHeadline. I did some editing of the documentation for this patch and noticed that the

Re: [HACKERS] [GENERAL] Fragments in tsearch2 headline

2009-04-13 Thread Tom Lane
Sushant Sinha sushant...@gmail.com writes: Headline generation uses hlCover to get fragments in text with *all* query items. In case there is no such fragment, it does not return anything. What you are asking will either require returning *maximally* matching covers or handling it as a

Re: [HACKERS] [GENERAL] Fragments in tsearch2 headline

2009-04-13 Thread Sushant Sinha
Headline generation uses hlCover to get fragments in text with *all* query items. In case there is no such fragment, it does not return anything. What you are asking will either require returning *maximally* matching covers or handling it as a separate case. -Sushant. On Mon, 2009-04-13 at

Re: [HACKERS] psql with Function Type in \df

2009-04-13 Thread David Fetter
On Mon, Apr 13, 2009 at 07:24:31PM -0400, Tom Lane wrote: David Fetter da...@fetter.org writes: Here's a patch that adds a Function Type column to \df while removing the now-redundant \da. Removing \da altogether was nowhere in the consensus, or even in the discussion AFAIR. It's back.

Re: [HACKERS] Unicode support

2009-04-13 Thread Gregory Stark
- - crossroads0...@googlemail.com writes: The original post seemed to be a contrived attempt to say you should use ICU. Indeed. The OP should go read all the previous arguments about ICU in our archives. Not at all. I just was making a suggestion. You may use any other library or

Re: [HACKERS] join ordering

2009-04-13 Thread Robert Haas
On Mon, Apr 13, 2009 at 7:17 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: This isn't a very good plan.  What we should do is first join the values expression against bar, and then join the resulting rows against foo.  The optimizer doesn't want to do that,

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Robert Haas
On Mon, Apr 13, 2009 at 7:06 PM, Tom Lane t...@sss.pgh.pa.us wrote: Josh Berkus j...@agliodbs.com writes: I would suggest putting this info in a separate table, pg_change.  It would have oid, catalog, user_changed, changed_on.  That way we could simply keep the data for all objects which have

Re: [HACKERS] proposal: add columns created and altered to pg_proc and pg_class

2009-04-13 Thread Pavel Stehule
2009/4/14 Josh Berkus j...@agliodbs.com: - what if I need to know about operators, operator classes, schemas, etc  etc Fine, let's log this info for those too (or else decide they're too obscure and don't - pg_class and pg_proc are certainly the most interesting cases). I would suggest

Re: [HACKERS] Unicode support

2009-04-13 Thread Andrew Gierth
Gregory == Gregory Stark st...@enterprisedb.com writes: I don't believe that the standard forbids the use of combining chars at all. RFC 3629 says: ... This issue is amenable to solutions based on Unicode Normalization Forms, see [UAX15]. Gregory This is the relevant part. Tom was