Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Magnus Hagander
I'm writing up the new GUCs, and noticed that max_prepared_transactions defaults to 5. This is too many for most applications (which don't use them at all) and far too few for applications which use them regularly. I think the intention was to have enough so you could test 'em (in

Re: [HACKERS] Why copy_relation_data only use wal when WALarchiving is enabled

2007-10-18 Thread Jacky Leng
You need to set $PGDATA before running the script. And psql,pg_ctl and pg_resetxlog need to be in $PATH. After running the script, restart postmaster and run SELECT * FROM t2. There should be one row in the table, but it's empty. I've tried this script, and superisingly found that T2 is not

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Jacky Leng
Heikki Linnakangas [EMAIL PROTECTED] writes: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. How about just allowing to use wal even WAL archiving is disabled? It

Re: [HACKERS] Why copy_relation_data only use wal when WALarchiving is enabled

2007-10-18 Thread Jacky Leng
Sorry, send the mail wrongly just now. You need to set $PGDATA before running the script. And psql,pg_ctl and pg_resetxlog need to be in $PATH. After running the script, restart postmaster and run SELECT * FROM t2. There should be one row in the table, but it's empty. I've tried this script

Re: [HACKERS] Why copy_relation_data only use wal when WALarchiving is enabled

2007-10-18 Thread Jacky Leng
You need to set $PGDATA before running the script. And psql,pg_ctl and pg_resetxlog need to be in $PATH. After running the script, restart postmaster and run SELECT * FROM t2. There should be one row in the table, but it's empty. I've tried this script on postgres (PostgreSQL) 8.3devel, and

Re: [HACKERS] Why copy_relation_data only use wal when WALarchiving is enabled

2007-10-18 Thread Jacky Leng
You need to set $PGDATA before running the script. And psql,pg_ctl and pg_resetxlog need to be in $PATH. After running the script, restart postmaster and run SELECT * FROM t2. There should be one row in the table, but it's empty. I've tried this script on postgres (PostgreSQL) 8.3devel, and

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Heikki Linnakangas
Jacky Leng wrote: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. How about just allowing to use wal even WAL archiving is disabled? It seems that recovery of

Re: [HACKERS] ts_rewrite aggregate API seems mighty ugly

2007-10-18 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Since we're already committed to an initdb for beta2, it's not quite too late to reconsider the API here. My feeling at the moment is that we should just drop the aggregate form of ts_rewrite; it does nothing you can't do better with the two-argument form,

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Heikki Linnakangas
Heikki Linnakangas wrote: Tom Lane wrote: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. Ok, I'll write a patch to do that. There's a small problem with that: DROP

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Pavel Stehule [EMAIL PROTECTED] wrote: this function can help with array's iteration. create function generate_iterator(anyarray) returns setof integer as $$ select i from generate_series(array_lower($1,1), array_upper($1,1)) g(i) $$

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Merlin Moncure [EMAIL PROTECTED]: On 10/18/07, Pavel Stehule [EMAIL PROTECTED] wrote: this function can help with array's iteration. create function generate_iterator(anyarray) returns setof integer as $$ select i from generate_series(array_lower($1,1),

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Merlin Moncure [EMAIL PROTECTED]: On 10/18/07, Pavel Stehule [EMAIL PROTECTED] wrote: this function can help with array's iteration. create function generate_iterator(anyarray) returns setof integer as $$ select i from generate_series(array_lower($1,1),

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Stephen Frost
* Magnus Hagander ([EMAIL PROTECTED]) wrote: Certainly an installation that *is* using 'em would want a higher setting. Can' we make the default 0, which is what the majority should want, and have the regression test explicitly set it up on the commandline? I'm with Magnus on this one.

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: Can' we make the default 0, which is what the majority should want, and have the regression test explicitly set it up on the commandline? No. It's a postmaster-start-time-only option, which means that your proposal breaks make installcheck.

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Magnus Hagander
Can' we make the default 0, which is what the majority should want, and have the regression test explicitly set it up on the commandline? No. It's a postmaster-start-time-only option, which means that your proposal breaks make installcheck. Bummer. There are lots of ways to break

Re: [HACKERS] ts_rewrite aggregate API seems mighty ugly

2007-10-18 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: The two-argument form may not be actively broken but it sounds not very integrated. Passing a string which is then planned as an SQL query is not very SQL-ish. True. I'll bet you don't like ts_stat() either. regards, tom lane

[HACKERS] upgrade from 8.0.3 to 8.1.10 crash

2007-10-18 Thread Boergesson, Cheryl
Hello. I am trying to upgrade from PostgreSQL 8.0.3 to PostgreSQL 8.1.10. I'm on WindowsXP and I'm compiling with Visual C++ 6.0. I have a very simple routine that works fine with the 8.0.3 version: int easy_connect() { exec sql connect to my_db as my_cnxtn; printf (connection

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: The best I can think of is to rename the obsolete file to relfilenode.stale, when it's scheduled for deletion at next checkpoint, and check for .stale-suffixed files in GetNewRelFileNode, and delete them immediately in DropTableSpace. This is

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: There was a very similar proposal a little while back (google: array_to_set). I think I like those names better since you are returning a set, not an iterator :-). I agree, this is a very poor choice of name. There should be some reference to arrays

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Tom Lane [EMAIL PROTECTED]: Merlin Moncure [EMAIL PROTECTED] writes: There was a very similar proposal a little while back (google: array_to_set). I think I like those names better since you are returning a set, not an iterator :-). I agree, this is a very poor choice of

[HACKERS] dblink un-named connection doesn't get re-used

2007-10-18 Thread Decibel!
Is it intentional that dblink's unnamed connections don't get re-used? stats=# select datname, usename from pg_stat_activity; datname | usename -+- stats | decibel (1 row) stats=# select dblink_connect('dbname=stats'); dblink_connect OK (1 row) stats=# select

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: The best I can think of is to rename the obsolete file to relfilenode.stale, when it's scheduled for deletion at next checkpoint, and check for .stale-suffixed files in GetNewRelFileNode, and delete them immediately in

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Florian G. Pflug
Heikki Linnakangas wrote: Tom Lane wrote: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. Ok, I'll write a patch to do that. What is the argument against making

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Florian G. Pflug
Heikki Linnakangas wrote: Tom Lane wrote: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. Ok, I'll write a patch to do that. What is the argument against making

Re: [HACKERS] dblink un-named connection doesn't get re-used

2007-10-18 Thread Decibel!
Sorry for the self-reply... On Oct 18, 2007, at 9:09 AM, Decibel! wrote: Is it intentional that dblink's unnamed connections don't get re-used? From the dblink docs (both 8.1 and HEAD): if only one argument is given, the connection is unnamed; only one unnamed connection can exist

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Heikki Linnakangas
Florian G. Pflug wrote: Heikki Linnakangas wrote: Tom Lane wrote: I tend to agree that truncating the file, and extending the fsync request mechanism to actually delete it after the next checkpoint, is the most reasonable route to a fix. Ok, I'll write a patch to do that. What is the

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Tom Lane
Florian G. Pflug [EMAIL PROTECTED] writes: What is the argument against making relfilenodes globally unique by adding the xid and epoch of the creating transaction to the filename? 1. Zero chance of ever backpatching. (I know I said I wasn't excited about that, but it's still a strike

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: Bummer. There are lots of ways to break installcheck though - locale being one I get biten by all the time... Hmm, which locale do you use and what breakage do you see? regards, tom lane ---(end of

Re: [HACKERS] Strange error dropping foreign key

2007-10-18 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: db=# alter table isi.items_stat drop constraint items_stat_item_id_fkey; ERROR: items_pkey is an index Context please? regards, tom lane ---(end of broadcast)--- TIP 4: Have you

[HACKERS] Strange error dropping foreign key

2007-10-18 Thread Magnus Hagander
db=# alter table isi.items_stat drop constraint items_stat_item_id_fkey; ERROR: items_pkey is an index The foreign key points to items.Item_id which is what's indexed by items_pkey. But I only wanted to drop that constraint. /Magnus ---(end of

[HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
Hi there, Is it possible to write a dynamic loaded C function as an UDP or TCP server? What we want to do it is: Add a search function which send a UDP package to remote UDP server and then listen to an UDP port, waiting for the result. Ideally, we don't close the UDP server after the search

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread D'Arcy J.M. Cain
On Thu, 18 Oct 2007 10:55:19 -0400 Billow Gao [EMAIL PROTECTED] wrote: Is it possible to write a dynamic loaded C function as an UDP or TCP server? What we want to do it is: Add a search function which send a UDP package to remote UDP server and then listen to an UDP port, waiting for the

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
On Thu, 18 Oct 2007 10:55:19 -0400 Billow Gao [EMAIL PROTECTED] wrote: Is it possible to write a dynamic loaded C function as an UDP or TCP server? What we want to do it is: Add a search function which send a UDP package to remote UDP server and then listen to an UDP port, waiting for the

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread D'Arcy J.M. Cain
On Thu, 18 Oct 2007 11:24:24 -0400 Billow Gao [EMAIL PROTECTED] wrote: I can write the network program. But I am not 100% sure whether I can add the c-language function ( http://www.postgresql.org/docs/8.2/interactive/xfunc-c.html) to PostgreSQL. The function will be dynamic loaded by

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Decibel!
On Oct 18, 2007, at 12:07 AM, Bruce Momjian wrote: Josh Berkus wrote: On Wednesday 17 October 2007 21:35, Tom Lane wrote: Josh Berkus [EMAIL PROTECTED] writes: I'm writing up the new GUCs, and noticed that max_prepared_transactions defaults to 5. This is too many for most applications

Re: [HACKERS] Why copy_relation_data only use wal whenWALarchivingis enabled

2007-10-18 Thread Florian G. Pflug
Tom Lane wrote: Florian G. Pflug [EMAIL PROTECTED] writes: What is the argument against making relfilenodes globally unique by adding the xid and epoch of the creating transaction to the filename? 1. Zero chance of ever backpatching. (I know I said I wasn't excited about that, but it's still

Re: [HACKERS] ts_rewrite aggregate API seems mighty ugly

2007-10-18 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Gregory Stark [EMAIL PROTECTED] writes: The two-argument form may not be actively broken but it sounds not very integrated. Passing a string which is then planned as an SQL query is not very SQL-ish. True. I'll bet you don't like ts_stat() either. It

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Gregory Stark
D'Arcy J.M. Cain [EMAIL PROTECTED] writes: On Thu, 18 Oct 2007 11:24:24 -0400 And use it in PostgreSQL like: = SELECT name, c_talktoremoteudp(emp, 1500) AS overpaid FROM emp WHERE name = 'Bill' OR name = 'Sam';

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Gregory Stark
Decibel! [EMAIL PROTECTED] writes: Actually, the amount of memory is a reason to default to 0, or change the name, or put a big comment in the config, because I very often saw databases where people had set this to a very high value under the impression that it impacted prepared

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
Thanks. This is what I want to know :-) Regards, Billow Yeah, what he wants is to implement a function in Postgres which does something like an LDAP or DNS lookup or something like that. Sure you can do this. The only tricky bit is the thing you mentioned about reusing the connection. You

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Kevin Grittner
On Thu, Oct 18, 2007 at 11:23 AM, in message [EMAIL PROTECTED], Gregory Stark [EMAIL PROTECTED] wrote: If it's set to 0 then there's no real reason we need to wal log lock operations. Do we currently take advantage of that fact, or log them anyway? -Kevin

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Jan de Visser
On Thursday 18 October 2007 12:27:59 Billow Gao wrote: Thanks.  This is what I want to know :-) Regards, Billow Yeah, what he wants is to implement a function in Postgres which does something like an LDAP or DNS lookup or something like that. Sure you can do this. The only tricky bit is

Re: [HACKERS] max_prepared_transactions default ... why 5?

2007-10-18 Thread Heikki Linnakangas
Kevin Grittner wrote: On Thu, Oct 18, 2007 at 11:23 AM, in message [EMAIL PROTECTED], Gregory Stark [EMAIL PROTECTED] wrote: If it's set to 0 then there's no real reason we need to wal log lock operations. Do we currently take advantage of that fact, or log them anyway? No, we log

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: Merlin Moncure [EMAIL PROTECTED] writes: There was a very similar proposal a little while back (google: array_to_set). I think I like those names better since you are returning a set, not an iterator :-). I agree, this is a very poor choice

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: generate_array_subscripts() maybe? array_to_set or array_expand seem a little better imo (shorter, and symmetry with array_accum()), unless you want to differentiate between internal funcs (array_cat and

Re: [HACKERS] upgrade from 8.0.3 to 8.1.10 crash

2007-10-18 Thread Boergesson, Cheryl
I found when I removed all comments, it worked fine. Any ideas? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Boergesson, Cheryl Sent: Thursday, October 18, 2007 9:24 AM To: pgsql-hackers@postgresql.org Subject: [HACKERS] upgrade from 8.0.3

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: I don't much like either of those, because they seem misleading: what I'd expect from a function named that way is that it returns the *elements* of the array, not their subscripts. Come to think of it, do we have a way of doing that directly?

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: On the question of being too long, I could live with generate_subscripts(). how about array_iota? I think a lot of people wouldn't get the reference. How about array_subscripts()?

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Joe Conway
Tom Lane wrote: Merlin Moncure [EMAIL PROTECTED] writes: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: generate_array_subscripts() maybe? array_to_set or array_expand seem a little better imo (shorter, and symmetry with array_accum()), unless you want to differentiate between internal

Re: [HACKERS] upgrade from 8.0.3 to 8.1.10 crash

2007-10-18 Thread Alvaro Herrera
Boergesson, Cheryl wrote: I found when I removed all comments, it worked fine. Any ideas? I suggest you add ECPG to the subject line so that the relevant developers notice your problem. -- Alvaro Herrera http://www.amazon.com/gp/registry/CTMLCN8V17R4 The Postgresql hackers

[HACKERS] ECPG crash - upgrade from 8.0.3 to 8.1.10

2007-10-18 Thread Boergesson, Cheryl
Hello. I am trying to upgrade from PostgreSQL 8.0.3 to PostgreSQL 8.1.10. I'm on WindowsXP and I'm compiling with Visual C++ 6.0. I have a very simple routine that works fine with the 8.0.3 version: int easy_connect() { exec sql connect to my_db as my_cnxtn; printf (connection

Re: [HACKERS] Release notes introductory text

2007-10-18 Thread Kevin Grittner
On Thu, Oct 18, 2007 at 12:34 AM, in message [EMAIL PROTECTED], Bruce Momjian [EMAIL PROTECTED] wrote: This release represents a major leap forward for PostgreSQL by adding significant new functionality and performance enhancements. This was made possible by a growing community that has

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: Merlin Moncure [EMAIL PROTECTED] writes: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: On the question of being too long, I could live with generate_subscripts(). how about array_iota? I think a lot of people wouldn't get the reference.

[HACKERS] I've discovered an error with the tcl pgmail function

2007-10-18 Thread qljsystems
Further to the thread Re: Send email from PostgreSQL, may I ? * From: Devrim GUNDUZ devrim ( at ) commandprompt ( dot ) com * To: Gerson Machado gersonamach ( at ) yahoo ( dot ) com ( dot ) br * Subject: Re: Send email from PostgreSQL, may I ? * Date: Fri, 27 Oct 2006

Re: [HACKERS] I've discovered an error with the tcl pgmail function

2007-10-18 Thread Tom Lane
[EMAIL PROTECTED] writes: There's a suggested function in pltclu to send emails from the postgre database. There's no such function anywhere in the core Postgres distribution, so I think you've reported this to the wrong place. regards, tom lane

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
done http://www.pgsql.cz/index.php/Iter%C3%A1tor_pole I'll send patch later Pavel 2007/10/18, Merlin Moncure [EMAIL PROTECTED]: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: Merlin Moncure [EMAIL PROTECTED] writes: On 10/18/07, Tom Lane [EMAIL PROTECTED] wrote: On the question of

Re: [HACKERS] dblink un-named connection doesn't get re-used

2007-10-18 Thread Joe Conway
Decibel! wrote: Is it intentional that dblink's unnamed connections don't get re-used? yes stats=# select dblink_connect('dbname=stats'); dblink_connect OK (1 row) stats=# select dblink_connect('dbname=postgres'); dblink_connect OK (1 row) AFAIK there's

Re: [HACKERS] [COMMITTERS] pgsql: Consistently indent release notes for prior releases.

2007-10-18 Thread Tom Lane
[EMAIL PROTECTED] (Bruce Momjian) writes: Consistently indent release notes for prior releases. Bruce, if you don't revert that patch I will do it for you. Random changes to the release.sgml sections for old releases are an utter nightmare when it comes time to produce back-branch updates.

Re: [HACKERS] upgrade from 8.0.3 to 8.1.10 crash

2007-10-18 Thread Tom Lane
Boergesson, Cheryl [EMAIL PROTECTED] writes: I found when I removed all comments, it worked fine. Any ideas? Oh? Considering that the fragments you've shown us have never had one single comment, that means that no one could possibly have offered you any useful advice. Please, if you would

[HACKERS] Re: [COMMITTERS] pgsql: Consistently indent release notes for prior releases.

2007-10-18 Thread Bruce Momjian
Tom Lane wrote: [EMAIL PROTECTED] (Bruce Momjian) writes: Consistently indent release notes for prior releases. Bruce, if you don't revert that patch I will do it for you. Random changes to the release.sgml sections for old releases are an utter nightmare when it comes time to produce