Re: [HACKERS] Python 3.0 does not work with PL/Python

2009-05-04 Thread Peter Eisentraut
On Monday 06 April 2009 02:10:59 James Pye wrote: Any thoughts on the acceptability of a complete rewrite for Python 3? http://www.joelonsoftware.com/articles/fog69.html -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] cleaning up stray references

2009-05-04 Thread Peter Eisentraut
On Sunday 03 May 2009 18:48:15 Robert Haas wrote: replace a couple of references to files that no longer exist in the source tree with references to the appropriate URLs. Done. I linked to Development_information instead of Developer_FAQ instead, as it is more general. -- Sent via

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: Now presumably we sleep for 1 sec between the CloseHandle() call and the CreateFileMapping() call in that code for a reason. I'm not sure. Magnus never did answer my question about why the sleep and retry was put in at all; it

[HACKERS] high shared buffer and swap

2009-05-04 Thread Laurent Laborde
Friendly greetings ! I found something odd (something that i can't explain) this weekend. An octocore server with 32GB of ram, running postgresql 8.3.6 Running only postgresql, slony-I and pgbouncer. Just for testing purpose, i tried a setting with 26GB of shared_buffer. I quickly noticed that

Re: [HACKERS] libpq is not thread safe

2009-05-04 Thread Zdenek Kotala
Tom Lane píše v ne 03. 05. 2009 v 16:39 -0400: Zdenek Kotala zdenek.kot...@sun.com writes: When postgreSQL is compiled with --thread-safe that libpq should be thread safe. But it is not true when somebody call fork(). The problem is that fork() forks only active threads and some mutex can

Re: [HACKERS] could not reattach to shared memory captured in buildfarm

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: vaquita has an interesting report today: http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=vaquitadt=2009-05-01%2020:00:06 Partway through the contrib tests, for absolutely no visible reason whatsoever, connections start to fail with FATAL: could not reattach to shared

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Magnus Hagander mag...@hagander.net writes: Tom Lane wrote: It says here: http://msdn.microsoft.com/en-us/library/ms885627.aspx FWIW, this is the Windows CE documentation. The one for win32 is at: http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx Sorry, that

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Magnus Hagander mag...@hagander.net writes: FWIW, this certainly used to work. So we've either broken this recently, or it's always been broken on Vista (I've never tried it myself on Vista, only 2000, XP and 2003). Maybe a quick check if it still works on non-Vista versions

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: Well, I can tell you that it is getting an exit code of 1, which is why the postmaster isn't restarting. Blech. Count on Windows to find a way to break things. Yup. A quick search gives this: http://support.microsoft.com/kb/155075

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Magnus Hagander
Andrew Dunstan wrote: justin wrote: Tom Lane wrote: Have M$ really been stupid enough to make an external kill look just like an exit() call? regards, tom lane kind of :-( Would it not be easy to set the normal exitcode to something other than 1 to see the

Re: [HACKERS] Why isn't stats_temp_directory automatically created?

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Fujii Masao masao.fu...@gmail.com writes: Here is the revised patch; If stats_temp_directory indicates the symlink, we pursue the chain of symlinks and create the referenced directory. I looked at this patch a bit. I'm still entirely unconvinced that we should be doing this

Re: [HACKERS] high shared buffer and swap

2009-05-04 Thread Greg Stark
Sorry for top-posting - the iphone mail client sucks. I think what's happening is that the sytem is seeing that some pages of shared memory haven't been used recently and because there's more shared memory than filesystem cache less recently than the filesystem cache pages. So it pages out

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: I wrote: The first idea that comes to mind is to have some sort of dead man switch that flags an active backend and is reset by proc_exit() after it's finished cleaning up everything else. If the postmaster sees this flag still set after backend exit, then it treats the

Re: [HACKERS] high shared buffer and swap

2009-05-04 Thread Martijn van Oosterhout
On Mon, May 04, 2009 at 10:57:47AM +0200, Greg Stark wrote: I think what's happening is that the sytem is seeing that some pages of shared memory haven't been used recently and because there's more shared memory than filesystem cache less recently than the filesystem cache pages. So it

Re: [HACKERS] Python 3.0 does not work with PL/Python

2009-05-04 Thread James Pye
On May 3, 2009, at 11:02 PM, Peter Eisentraut wrote: http://www.joelonsoftware.com/articles/fog69.html Good read. =) However, complete rewrite being relative in this case: WIP:

Re: [HACKERS] Documentation: GiST extension implementation

2009-05-04 Thread Peter Eisentraut
On Wednesday 29 April 2009 16:43:44 Dimitri Fontaine wrote: The following documentation page explains the GiST API to extensions authors: I think we should be a little more verbose, I didn't propose a real doc patch mainly because english isn't my native language, and while you'll have to

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: Tom Lane wrote: Another thought that came to mind: we could set up an atexit hook that This sounds like a good idea in general - because it will avoid having to restart on unix. It'd still have to be combined with the dead-man-switch idea to

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Andrew Dunstan
Magnus Hagander wrote: Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: Now presumably we sleep for 1 sec between the CloseHandle() call and the CreateFileMapping() call in that code for a reason. I'm not sure. Magnus never did answer my question about why the

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Magnus Hagander wrote: The actual 1 second value was completely random - it fixed all the issues on my test VM at the time. I don't recall exactly the details, but I do recall having to run a lot of tests before I managed to provoke an error, and

Re: [HACKERS] could not reattach to shared memory captured in buildfarm

2009-05-04 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: Somebody else mentioned, and IIRC I talked to Dave about this before, that this could be because the address is no longer available. The reason for this could be some kind of race condition in the backends starting - the address is available when the

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Andrew Dunstan
Tom Lane wrote: I still think there's absolutely no evidence suggesting that a variable backoff is necessary. Given how little this code is going to be exercised in the real world, how long will it take till we find out if you get it wrong? Use a simple retry loop and be done with it.

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: Magnus Hagander wrote: The actual 1 second value was completely random - it fixed all the issues on my test VM at the time. I don't recall exactly the details, but I do recall having to run a lot of tests before I managed to provoke

Re: [HACKERS] [PERFORM] high shared buffer and swap

2009-05-04 Thread Scott Marlowe
On Mon, May 4, 2009 at 2:10 AM, Laurent Laborde kerdez...@gmail.com wrote: Friendly greetings ! I found something odd (something that i can't explain) this weekend. An octocore server with 32GB of ram, running postgresql 8.3.6 Running only postgresql, slony-I and pgbouncer. Just for testing

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Andres Freund
On 05/04/2009 04:10 PM, Andres Freund wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit easier. Oh, and to any other

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Alvaro Herrera
Magnus Hagander wrote: Andrew, you want to write up a patch or do you want me to do it? This is going to be backpatched, I assume? -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-hackers mailing

[HACKERS] Synchronous replication: Promotion of Standby to Primary

2009-05-04 Thread K, Niranjan (NSN - IN/Bangalore)
Hi, Re-opening the discussion related to triggers to promote standby server. In the earlier dicussion, there were 2 proposals, Trigger based on file and trigger based on signals. I think there was no conclusion on this. http://archives.postgresql.org/pgsql-hackers/2008-12/msg01231.php According

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: This is going to be backpatched, I assume? Yeah, back to 8.2 I suppose. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: Tom Lane wrote: I still think there's absolutely no evidence suggesting that a variable backoff is necessary. Given how little this code is going to be exercised in the real world, how long will it take till we find out if you get it wrong? Use a

Re: [HACKERS] could not reattach to shared memory captured in buildfarm

2009-05-04 Thread Magnus Hagander
Tom Lane wrote: Magnus Hagander mag...@hagander.net writes: Somebody else mentioned, and IIRC I talked to Dave about this before, that this could be because the address is no longer available. The reason for this could be some kind of race condition in the backends starting - the address is

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Andrew Dunstan
Magnus Hagander wrote: Andrew, you want to write up a patch or do you want me to do it? Go for it. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

[HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Andres Freund
Hi, Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit easier. Andres -- Sent via pgsql-hackers mailing list

[HACKERS] hellow Postmaster and Postgres

2009-05-04 Thread abdelhak benmohamed
hi please I want to understands what is the tie between Postgres.c and Postmaster.c thanks  

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Robert Haas
On Mon, May 4, 2009 at 10:10 AM, Andres Freund and...@anarazel.de wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit

Re: [HACKERS] hellow Postmaster and Postgres

2009-05-04 Thread Peter Eisentraut
On Monday 04 May 2009 17:24:29 abdelhak benmohamed wrote: what is the tie between Postgres.c and Postmaster.c Roughly speaking, postgres.c is the server session process, and postmaster.c is the master process that forks the session processes. The entry point to everything is in main.c. Start

Re: [HACKERS] hellow Postmaster and Postgres

2009-05-04 Thread Robert Haas
On Mon, May 4, 2009 at 10:24 AM, abdelhak benmohamed abdelhak.benmoha...@yahoo.fr wrote: hi please I want to understands what is the tie between Postgres.c and Postmaster.c thanks Like most of the questions you've posted to the list in the last month, this question is so general that I'm

[HACKERS] Synchronous replication: replication_timeout parameter

2009-05-04 Thread K, Niranjan (NSN - IN/Bangalore)
Hi, This is with respect to the planned GUC parameter 'replication_timeout' which used in context with 'replication_timeout_action' parameter. http://archives.postgresql.org/pgsql-hackers/2008-12/msg01231.php Here the proposal is to use the milliseconds as the unit for the 'replication_timeout'.

[HACKERS] Synchronous replication: Admin command for replication_timeout_action

2009-05-04 Thread K, Niranjan (NSN - IN/Bangalore)
Hi, This is to support an admin command or utility which can trigger the server to be taken to a standalone mode if there a connection failure detection between Primary and server. It need not be always, that the replication_timeout needs to be accomplished to detect the connection failure

[HACKERS] ALTER TABLE should change respective views

2009-05-04 Thread Archana Sundararam
hi, I have many views dependent on a table. So whenever I do alter table and change the column type I have to drop and recreate all the views. Is there any other easy way to propagate the changes in the table to the views. Any suggestion is welcome. Thanks,Archana

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Magnus Hagander
Andrew Dunstan wrote: Magnus Hagander wrote: Andrew, you want to write up a patch or do you want me to do it? Go for it. How does this look? Passes my tests, but I can't really reproduce the requirement to retry, so I haven't been able to test that part :( //Magnus ***

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Alvaro Herrera
Magnus Hagander wrote: How does this look? Passes my tests, but I can't really reproduce the requirement to retry, so I haven't been able to test that part :( I'm disappointed :-( I thought this thread (without reading it too deeply) was about fixing the problem that backends sometimes

Re: [HACKERS] Unicode string literals versus the world

2009-05-04 Thread Peter Eisentraut
On Tuesday 14 April 2009 21:34:51 Peter Eisentraut wrote: On Tuesday 14 April 2009 17:13:00 Marko Kreen wrote: If the parsing does not happen in 2 passes and it does not take account of stdstr setting then the default breakage would be: stdstr=off, U' \' UESCAPE '!'. I think we can

Re: [HACKERS] windows doesn't notice backend death

2009-05-04 Thread Tom Lane
I wrote: I don't think we'll be able to prevent PHP from doing that :-(. But it now seems clear that we should try to make the database as a whole recover with some degree of grace. I'll go work up a patch. Attached is a proposed patch for the dead man switch idea. The switch is armed when

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: I'm disappointed :-( I thought this thread (without reading it too deeply) was about fixing the problem that backends sometimes fail to connect to shmem, on a system that's been running for a while. Nobody knows yet what's wrong there or how

Re: [HACKERS] windows shared memory error

2009-05-04 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: Passes my tests, but I can't really reproduce the requirement to retry, so I haven't been able to test that part :( The patch looks sane to me. If you want to test, perhaps reducing the sleep to 1 msec or so would reproduce the need to go around the

Re: [HACKERS] Unicode string literals versus the world

2009-05-04 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Tuesday 14 April 2009 21:34:51 Peter Eisentraut wrote: I think we can handle that and the cases Tom presents by erroring out when the U syntax is used with stdstr off. Proposed patch for that attached. I have not been able to think of any security

[HACKERS] ERROR: out of memory when using aggregates over a partitioned table

2009-05-04 Thread Matteo Beccati
Hi everyone, I'm unexpectedly getting out of memory error both with 8.3.3 and 8.4beta1 when doing something as simple as: SELECT id, COUNT(*) AS counter, MAX(last_modified) AS last_modified FROM foo GROUP BY id; where foo is a partitioned table and id is a uuid column. It looks like the

[HACKERS] community equipment

2009-05-04 Thread Mark Wong
Hi all, It has been brought to our attention that many in the PostgreSQL community are still not aware that we have equipment which has been donated for community use (e.g. development and testing). As requested we have set up an additional web page on pgfoundy and a new mailing list to discuss

Re: [HACKERS] could not reattach to shared memory captured in buildfarm

2009-05-04 Thread Alvaro Herrera
Magnus Hagander wrote: I didn't mean race condition between backends. I meant against a potential other thread started by a loaded DLL for initialization. (Again, things like antivirus are known to do this, and we do see these issues more often if AV is present for example) I don't

Re: [HACKERS] Unicode string literals versus the world

2009-05-04 Thread Hiroshi Saito
Hi. quick test for great patch. ! == SCRIPT == set CLIENT_ENCODING to 'UTF-8'; DROP TABLE ucheck CASCADE; CREATE TABLE ucheck (key VARCHAR(10) PRIMARY KEY, data NCHAR(50)); set STANDARD_CONFORMING_STRINGS to on; INSERT INTO ucheck VALUES('ucheck1',u'\68ee\9dd7\5916'); SELECT * FROM ucheck; set

Re: [HACKERS] ALTER TABLE ... ALTER COLUMN ... SET DISTINCT

2009-05-04 Thread Joshua Tolley
On Mon, May 04, 2009 at 10:13:31PM -0400, Robert Haas wrote: nit + own analysis indicates otherwie). When set to a negative value, which s/otherwie/otherwise /nit A question: why does attdistinct become entry #5 instead of going at the end? I assume it's because the order here controls