Re: [GENERAL] WARNING: some databases have not been vacuumed in 1953945422 transactions

2007-02-19 Thread Albe Laurenz
But I don't understand why there are changes of the databases template1 and template0 at all? I thought they are only templates. I don't think that there were any changes to the template databases. You detected a difference in age(datfrozenxid) - try selecting datfrozenxid itself and you

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Alban Hertroys
Michael Glaesemann wrote: On Feb 18, 2007, at 20:29 , Karsten Hilbert wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc depends on the time zone setting for the session. I understand the reasoning,

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Michael Glaesemann
On Feb 19, 2007, at 18:04 , Alban Hertroys wrote: Michael Glaesemann wrote: On Feb 18, 2007, at 20:29 , Karsten Hilbert wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc depends on the time zone

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Michael Glaesemann
On Feb 18, 2007, at 23:12 , Karsten Hilbert wrote: On Sun, Feb 18, 2007 at 09:19:43PM +0900, Michael Glaesemann wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc depends on the time zone setting for the

Re: [GENERAL] complex referential integrity constraints

2007-02-19 Thread Alban Hertroys
Robert Haas wrote: So, I have the following problem. Suppose you have two kinds of animals, sheep and wolves. Since they have very similar properties, you create a single table to hold both kinds of animals, and an animal_type table to specify the type of each animal: CREATE TABLE

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Alban Hertroys
Michael Glaesemann wrote: On Feb 19, 2007, at 18:04 , Alban Hertroys wrote: Michael Glaesemann wrote: On Feb 18, 2007, at 20:29 , Karsten Hilbert wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc

Re: [GENERAL] open source - content management system - that uses PostGreSQL

2007-02-19 Thread Andrew Kelly
On Sun, 2007-02-18 at 09:59 -0500, John DeSoi wrote: On Feb 16, 2007, at 4:13 PM, Andrew Kirkness wrote: I am currently setting up a website and have PostGreSQL database I'm using for the backend. I'm researching an open source Content Management System that uses PostGreSQL. Do you

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 10:16:12AM +0100, Alban Hertroys wrote: What I'm trying to say is not that it _is_ immutable, but that it _behaves_ immutable (under said conditions). This could imply that if a certain condition is available in a query on which such a function operates, it would

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Martijn van Oosterhout
On Mon, Feb 19, 2007 at 10:36:36AM +0100, Karsten Hilbert wrote: On Mon, Feb 19, 2007 at 10:16:12AM +0100, Alban Hertroys wrote: What I'm trying to say is not that it _is_ immutable, but that it _behaves_ immutable (under said conditions). This could imply that if a certain condition

Re: [GENERAL] complex referential integrity constraints

2007-02-19 Thread Joris Dobbelsteen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of elein Sent: zondag 18 februari 2007 23:16 To: Robert Haas Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] complex referential integrity constraints On Fri, Feb 16, 2007 at 09:58:56AM -0500, Robert

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 10:58:50AM +0100, Martijn van Oosterhout wrote: I'll solve it with a date_trunc_utc() wrapper. It should be noted the date_truc(timestamptz) is not immutable, whereas date_trunc(timestamp) is. Thus you should be able to make an index on: date_trunc(

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Martijn van Oosterhout
On Mon, Feb 19, 2007 at 12:03:07PM +0100, Karsten Hilbert wrote: date_trunc( timestamptz_column AT TIME ZONE 'UTC', 'foo' ) Ah, that makes it clear *why* this should work. I would assume to get meaningful results from a query using that index I'd have to normalize input timestamps to UTC,

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 12:53:15PM +0100, Martijn van Oosterhout wrote: Well, your queries need to use the same form, ie: SELECT blah FROM foo WHERE date_trunc( 'entered_timestamp'::timestamptz AT TIME ZONE 'UTC', 'foo' ) Thought so. That seems a bit error prone though, so your idea of

Re: [GENERAL] Small request re error message

2007-02-19 Thread Alvaro Herrera
Bruce Momjian wrote: Scott Ribe wrote: Oh. Yea, I can see that, but even if the endian-ness is the same, it still might not work. Even a different compiler flag will cause a failure to run properly. Sure. You can't flag every possible error. But my Intel PPC Macs look

Re: [GENERAL] Synchronize tables question....

2007-02-19 Thread Jerry LeVan
On Feb 19, 2007, at 9:05 AM, Richard Huxton wrote: Don't forget to CC: the list Jerry LeVan wrote: Is there an elegant way I can merge/update the two tables so that they will contain the same information ( with no duplicates or omissions)? It sounds like you'll want some form of

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Tom Lane
Alban Hertroys [EMAIL PROTECTED] writes: What I'm trying to say is not that it _is_ immutable, but that it _behaves_ immutable (under said conditions). This could imply that if a certain condition is available in a query on which such a function operates, it would behave immutable. Right, but

[GENERAL] Per Database Roles

2007-02-19 Thread David Legault
Hello, Is there a way to attach roles to only certain databases so that the login [from PHP pg_connect(username, password, database)] is tied to that particular database and any creation of roles (users/groups) can be constrained into that particular database. I plan to use the roles system to

[GENERAL] RPM compat-postgresql-libs-4-2 for IA-64

2007-02-19 Thread DANTE Alexandra
Hello List, I work with PostgreSQL 8.2.3 on a IA-64 server with Red Hat Enterprise Linux 4 AS update 2 and I am looking for the RPM compat-postgresql-libs-4-2 associated. Unfortunately, I didn't find it on http://www.postgresql.org/ftp/binary/, even in the RPM available for the 8.2.1 release

[GENERAL] How to force disconnections from a Perl script?

2007-02-19 Thread Kynn Jones
I have a Perl script that runs every night and updates a local Pg database, sitting on a Linux server. (I'll refer to this database as mydb in the following.) The update process takes about 1 hour, so the script first builds a temporary database called mydb_tmp. Once mydb_tmp is built and

Re: [GENERAL] How to force disconnections from a Perl script?

2007-02-19 Thread Martijn van Oosterhout
On Mon, Feb 19, 2007 at 11:10:55AM -0500, Kynn Jones wrote: The script is quite solid and has been performing flawlessly for several months now, with one exception: it fails irrecoverably whenever some user forgets to disconnect from mydb at the time that the script attempts to delete it (or

Re: [GENERAL] How to force disconnections from a Perl script?

2007-02-19 Thread Csaba Nagy
Why irrecoverably? If the command fails, you just wait and try it again. You could use the pg_stat tables to work out who is connected and use pg_cancel_backend() to kill them. You could kill -INT them yourself. You could change the pg_hba.conf to forbid logging in and then bouncing the

Re: [GENERAL] open source - content management system - that uses PostGreSQL

2007-02-19 Thread Vivek Khera
On Feb 16, 2007, at 4:13 PM, Andrew Kirkness wrote: I am currently setting up a website and have PostGreSQL database I'm using for the backend. I'm researching an open source Content Management System that uses PostGreSQL. Do you have any recommendations? You need to define what you

Re: [GENERAL] open source - content management system - that uses PostGreSQL

2007-02-19 Thread Jeff Ross
Vivek Khera wrote: On Feb 16, 2007, at 4:13 PM, Andrew Kirkness wrote: I am currently setting up a website and have PostGreSQL database I'm using for the backend. I'm researching an open source Content Management System that uses PostGreSQL. Do you have any recommendations? You need to

Re: [GENERAL] complex referential integrity constraints

2007-02-19 Thread David Fetter
On Fri, Feb 16, 2007 at 09:58:56AM -0500, Robert Haas wrote: So, I have the following problem. Suppose you have two kinds of animals, sheep and wolves. Since they have very similar properties, you create a single table to hold both kinds of animals, and an animal_type table to specify the

Re: [GENERAL] How to force disconnections from a Perl script?

2007-02-19 Thread Frank Finner
Hi, you could let the script look into the output of ps aux. Open idle connections are usually show like this: postgres 18383 0.0 0.6 18596 4900 ?Ss 16:38 0:00 postgres: dbuser database hostname(39784) idle in transaction Then you can simply collect the PIDs and kill these

Re: [GENERAL] complex referential integrity constraints

2007-02-19 Thread Richard Broersma Jr
I'd do something like this: CREATE TABLE animal_type ( animal_name TEXT PRIMARY KEY, CHECK(animal_name = trim(animal_name)) ); /* Only one of {Wolf,wolf} can be in the table. */ CREATE UNIQUE INDEX just_one_animal_name ON animal_type(LOWER(animal_name)); CREATE TABLE

[GENERAL] Out of memory on vacuum analyze

2007-02-19 Thread John Cole
I have a large table (~55 million rows) and I'm trying to create an index and vacuum analyze it. The index has now been created, but the vacuum analyze is failing with the following error: ERROR: out of memory DETAIL: Failed on request of size 943718400. I've played with several settings, but

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Bruno Wolff III
On Sun, Feb 18, 2007 at 12:29:17 +0100, Karsten Hilbert [EMAIL PROTECTED] wrote: The date-of-birth field in our table holding patients is of type timestamp with time zone. One of our patient search queries uses the date-of-birth field to find matches. Since users enter day, month, and year

Re: [GENERAL] Out of memory on vacuum analyze

2007-02-19 Thread Jeff Davis
On Mon, 2007-02-19 at 12:47 -0600, John Cole wrote: I have a large table (~55 million rows) and I'm trying to create an index and vacuum analyze it. The index has now been created, but the vacuum analyze is failing with the following error: ERROR: out of memory DETAIL: Failed on request

Re: [GENERAL] Database performance comparison paper.

2007-02-19 Thread Andrew Sullivan
On Sat, Feb 17, 2007 at 12:02:08AM +0100, Leif B. Kristensen wrote: There ought to be a proper name for this kind of pseudo-technical Gonzo journalism. There is, but it's not the sort of word one uses in polite company ;-) A -- Andrew Sullivan | [EMAIL PROTECTED] Unfortunately

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 12:41:11PM -0600, Bruno Wolff III wrote: Karsten Hilbert [EMAIL PROTECTED] wrote: The date-of-birth field in our table holding patients is of type timestamp with time zone. One of our patient search queries uses the date-of-birth field to find matches. Since

Re: [GENERAL] Per Database Roles

2007-02-19 Thread John DeSoi
On Feb 19, 2007, at 10:32 AM, David Legault wrote: Is there a way to attach roles to only certain databases so that the login [from PHP pg_connect(username, password, database)] is tied to that particular database and any creation of roles (users/ groups) can be constrained into that

Re: [GENERAL] [pgsql-es-ayuda] postgreSQL

2007-02-19 Thread David Primero Segundo
amigo en este enlace te explican paso a paso como instalar postgresql, yo tengo debian e instale postgre 8.2.1 siguiendo los pasos de dicho link. a ver que te parece: http://www.postgresql.org.mx/?q=node/9 From: Edwin Quijada [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]

[GENERAL] Postgresql Kilitli Satır Kontrolü

2007-02-19 Thread Ahmet
Merhaba, PlanetPostgreSQLi incelerken şu örnek gözüme çarptı Greg Sabino Mullane Determining which rows in a table are locked CREATE OR REPLACE FUNCTION isrowlocked(text,text,text) RETURNS BOOL LANGUAGE plpgsql VOLATILE STRICT AS $gsm$ DECLARE myst TEXT; BEGIN myst = 'SELECT 1 FROM

Re: [GENERAL] RPM compat-postgresql-libs-4-2 for IA-64

2007-02-19 Thread Devrim GUNDUZ
Hello, On Mon, 2007-02-19 at 16:49 +0100, DANTE Alexandra wrote: Where can I find the RPM compat-postgresql-libs-4-2 for RHEL4-AS and IA-64 ? Those libs are extracted from 8.1.X RPMs and put together to form an RPM package. If you can build and send us 8.1.8 RPMs, I can build and upload that

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Bruno Wolff III
On Mon, Feb 19, 2007 at 20:48:07 +0100, Karsten Hilbert [EMAIL PROTECTED] wrote: What time of day were you born ? http://en.wikipedia.org/wiki/Apgar What is the technical reason that makes you wonder ? Because it would make doing the queries simpler. If you aren't collecting the

[GENERAL] boolean operator on interval producing strange results

2007-02-19 Thread Merlin Moncure
We updated our production server to postgresql 8.2.3 yesterday. This query is giving different results than on our development box: development: # select ((now() - '1 day'::interval)::timestamp - now()) 0; ?column? -- t (1 row) production # select ((now() - '1

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 03:28:01PM -0600, Bruno Wolff III wrote: What is the technical reason that makes you wonder ? Because it would make doing the queries simpler. If you aren't collecting the data, it doesn't make sense to deal with the extra headaches involved with pretending you know

Re: [GENERAL] Database performance comparison paper.

2007-02-19 Thread Geoffrey
Tom Allison wrote: Leif B. Kristensen wrote: On Friday 16. February 2007 07:10, Tom Lane wrote: Perhaps this paper can be described as comparing an F-15 to a 747 on the basis of required runway length. There ought to be a proper name for this kind of pseudo-technical Gonzo journalism. The

Re: [GENERAL] Database performance comparison paper.

2007-02-19 Thread Jan Wieck
On 2/16/2007 1:10 AM, Tom Lane wrote: extra points, use *only one* test case. Perhaps this paper can be described as comparing an F-15 to a 747 on the basis of required runway length. Oh, this one wasn't about raw speed of trivial single table statements like all the others? Jan --

[GENERAL] pgPL/SQL Documentation

2007-02-19 Thread Ivan Wills
Hi, I have had a look around but I have not found any documentation on pgPL/SQL. I know it is meant to be similar to Oracle's PL/SQL but as I don't know PL/SQL so that does not do me any good. If there is documentation for pgPL/SQL it would be nice to see it as part of the documentation for the

Re: [GENERAL] pgPL/SQL Documentation

2007-02-19 Thread Joshua D. Drake
Ivan Wills wrote: Hi, I have had a look around but I have not found any documentation on pgPL/SQL. I know it is meant to be similar to Oracle's PL/SQL but as I don't know PL/SQL so that does not do me any good. If there is documentation for pgPL/SQL it would be nice to see it as part of

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread jungmin shin
I have a question about the query optimizer of a postgres. As long as I understood through a postgres manual, the postgres query optimizer is implemented using a *genetic algorithm.* I'm thinking to modify the query optimizer. Are there any postgres version which uses typical dynamic

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Alvaro Herrera
jungmin shin escribió: I have a question about the query optimizer of a postgres. As long as I understood through a postgres manual, the postgres query optimizer is implemented using a *genetic algorithm.* There is an algorithm said to be genetic, but it only kicks in with big joins; 12

Re: [GENERAL] How to force disconnections from a Perl script?

2007-02-19 Thread Tom Lane
Csaba Nagy [EMAIL PROTECTED] writes: And pg_stat will only show you running queries, not the idle connections. Nonsense. pg_stat_activity + kill -TERM should solve this problem reasonably well. Some of us don't trust kill -TERM 100%, which is why it's not currently exposed as a standard

Re: [GENERAL] complex referential integrity constraints

2007-02-19 Thread David Fetter
On Mon, Feb 19, 2007 at 10:52:51AM -0800, Richard Broersma Jr wrote: I'd do something like this: CREATE TABLE animal_type ( animal_name TEXT PRIMARY KEY, CHECK(animal_name = trim(animal_name)) ); /* Only one of {Wolf,wolf} can be in the table. */ CREATE UNIQUE INDEX

[GENERAL] Syncing postgres data with Pocket PC

2007-02-19 Thread Justin Dearing
Hello, I need a way to sync a postgres view with a table on a Windows CE device. The table will be read only on the mobile device. I am seeking to replace an access database that syncs a table with a pocket pc table via active sync. I would really like to use postgres for the desktop side of

Re: [GENERAL] boolean operator on interval producing strange results

2007-02-19 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: # select ((now() - '1 day'::interval)::timestamp - now()) 0; ?column? -- f -- looks busted to me (1 row) If you'd casted to timestamptz then I'd agree this is busted. As-is, it might have something to do with your timezone setting, which