[GENERAL] Char vs SmallInt

2007-07-20 Thread Pg Coder
Which data type is smaller and will lead to better query performance - smallint or char?

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Tom Lane
"Josh Tolley" <[EMAIL PROTECTED]> writes: > Might it just be that the original UNIQUE + NOT NULL index was bloated > or otherwise degraded, and reindexing it would have resulted in the > same performance gain? That's just a guess. Yeah. There is precious little difference between UNIQUE+NOT NULL

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Josh Tolley
On 7/20/07, Michael Glaesemann <[EMAIL PROTECTED]> wrote: On Jul 20, 2007, at 17:54 , Vincenzo Romano wrote: > In an inner join involving a 16M+ rows table and a 100+ rows table > performances got drastically improved by 100+ times by replacing a > UNIQUE-NOT NULL index with a PRIMARY KEY on th

Re: [GENERAL] query optimizer

2007-07-20 Thread Tom Lane
Luca Ferrari <[EMAIL PROTECTED]> writes: >> src/backend/optimizer/README > I've read this yesterday, very interesting, but I'm looking for something > similar related to geqo. I mean, is there any presentation/demo that > step-y-step explains how geqo could take decisions? There's not a lot, bu

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Michael Glaesemann
On Jul 20, 2007, at 19:37 , Jeff Davis wrote: I only mentioned it because in 8.3 it will be useful for general use. I don't know what's changing about it between now and then, but it's becoming "un-deprecated". AFAIK, nothing's changed in the actual constraint trigger code: it's just a do

Re: [GENERAL] psql-odbc configure error

2007-07-20 Thread Hiroshi Saito
Hi. Umm, I don't understand your build environment well However, The following examination may help to find a problem. -- long_test.c - start --- long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () {

Re: [GENERAL] Solved? Re: 8.2.4 signal 11 with large transaction

2007-07-20 Thread Andrew - Supernews
On 2007-07-20, Bill Moran <[EMAIL PROTECTED]> wrote: > It just occurred to me that there's another wildcard in this one. > The 8.1 system I tested was on FreeBSD 5.5, while both 8.2 systems > were running on FreeBSD 6.2. I wonder if FreeBSD has changed > which signal gets sent on memory exhaustion

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Jeff Davis
On Fri, 2007-07-20 at 19:18 -0500, Perry Smith wrote: > > The relational model handles inheritance and polymorphism very well if > > you don't store types as values. > > What if I have just an id for an item? This will happen when another > table references an item. How do I know what type it

Re: [GENERAL] two phase commit

2007-07-20 Thread Jeff Davis
On Fri, 2007-07-20 at 15:26 -0400, Andrew Sullivan wrote: > On Thu, Jul 19, 2007 at 03:13:27PM -0700, Ben wrote: > > What corner case reduces 2pc from "guaranteed" to "very high probability"? > > Is the worry if somebody leaves transactions in a prepared state for > > weeks, only to find that dea

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
On Jul 20, 2007, at 7:01 PM, Jeff Davis wrote: On Fri, 2007-07-20 at 09:27 -0500, Perry Smith wrote: On Jul 20, 2007, at 9:06 AM, Michael Fuhr wrote: On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: I want to do something like this: ALTER TABLE companies ADD CONSTRAINT fk_compa

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Jeff Davis
On Fri, 2007-07-20 at 09:27 -0500, Perry Smith wrote: > On Jul 20, 2007, at 9:06 AM, Michael Fuhr wrote: > > > On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: > >> I want to do something like this: > >> > >> ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id > >> F

Re: [GENERAL] When is PostgreSQL 8.3 slated for release?

2007-07-20 Thread Michael Glaesemann
On Jul 20, 2007, at 6:37 , Tom Allison wrote: x.0 to x.1 is a lot of relatively easy things to address from a major point release. From 8.0 to 8.1 is a major release for PostgreSQL. 8.0, 8.1, and 8.2 are all major releases. "Point" releases for PostgreSQL are, for example, from 8.0.1 to

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Michael Glaesemann
On Jul 20, 2007, at 17:54 , Vincenzo Romano wrote: In an inner join involving a 16M+ rows table and a 100+ rows table performances got drastically improved by 100+ times by replacing a UNIQUE-NOT NULL index with a PRIMARY KEY on the very same columns in the very same order. The query has not be

[GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Vincenzo Romano
Hi all. Maybe mine is a stupid question, but I'd like to know the answer if possible. In an inner join involving a 16M+ rows table and a 100+ rows table performances got drastically improved by 100+ times by replacing a UNIQUE-NOT NULL index with a PRIMARY KEY on the very same columns in the ver

Re: [GENERAL] Feature request: Per database search_path

2007-07-20 Thread Jim C. Nasby
On Wed, Jul 18, 2007 at 11:02:51PM +0100, Richard Huxton wrote: > Francisco Reyes wrote: > >As far as I know, currently one can set the search path globally, or on > >a per role bases. > > > >I was wondering if it could be possible to have a per database search_path. > >I believe this would be not

Re: [GENERAL] Reminder: PostgreSQL PDXPGDay + PostgreSQL Party

2007-07-20 Thread Joshua D. Drake
Joshua D. Drake wrote: Hello, This is a reminder to everyone that we hare have a PDXPGDay at the Oregon Convention Center on July 22nd. The schedule can be found here: http://pdxgroups.pbwiki.com/PDXPUG%20PostgreSQL%20Day http://developer.postgresql.org/index.php/OSCON2007#PostgreSQL_Day_July

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > Oddly, the query succeeds if it's fed into psql. > I'm now full of mystery and wonder. It would appear as if the > underlying problem has something to do with PHP, but why should this > cause a backend process to crash? Ah, I see it. Your PHP script is s

Re: Solved? Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Bill Moran
In response to Bill Moran <[EMAIL PROTECTED]>: > In response to "Scott Marlowe" <[EMAIL PROTECTED]>: [snip] > I'm starting to wonder if the OS could be sending the sig 11? > > ... time warp ... > > Yup, that was it. The OS was limiting the amount of memory a single > process could use via kern.

Solved? Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Bill Moran
In response to "Scott Marlowe" <[EMAIL PROTECTED]>: > On 7/20/07, Bill Moran <[EMAIL PROTECTED]> wrote: > > In response to Tom Lane <[EMAIL PROTECTED]>: > > > > > Bill Moran <[EMAIL PROTECTED]> writes: > > > > I'm now full of mystery and wonder. It would appear as if the > > > > underlying proble

Re: [GENERAL] two phase commit

2007-07-20 Thread Andrew Sullivan
On Thu, Jul 19, 2007 at 03:13:27PM -0700, Ben wrote: > What corner case reduces 2pc from "guaranteed" to "very high probability"? > Is the worry if somebody leaves transactions in a prepared state for > weeks, only to find that deadlock issues has arrisen at final commit time? That's not the wor

[GENERAL] OSCON Booth volunteers

2007-07-20 Thread Joshua D. Drake
Hello, My current list for volunteers is: * Alvaro Herrera * Josh Berkus * Joshua D. Drake * Chris Travers * David Fetter * Michael Alan Brewer * Robert Bernier * Selena Decklemann (part time) (PDXPUG) * Gabrielle 1-2pm Wednesday (PDXPUG) Am I missing anyone? Joshua D. Drake -- === The

[GENERAL] Reminder: PostgreSQL PDXPGDay + PostgreSQL Party

2007-07-20 Thread Joshua D. Drake
Hello, This is a reminder to everyone that we hare have a PDXPGDay at the Oregon Convention Center on July 22nd. The schedule can be found here: http://pdxgroups.pbwiki.com/PDXPUG%20PostgreSQL%20Day http://developer.postgresql.org/index.php/OSCON2007#PostgreSQL_Day_July_22 We are also having

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Scott Marlowe
On 7/20/07, Bill Moran <[EMAIL PROTECTED]> wrote: In response to Tom Lane <[EMAIL PROTECTED]>: > Bill Moran <[EMAIL PROTECTED]> writes: > > I'm now full of mystery and wonder. It would appear as if the > > underlying problem has something to do with PHP, but why should this > > cause a backend

[GENERAL] psql-odbc configure error

2007-07-20 Thread djisgitt
This message bounced from psql-odbc (I suppose because I am not subscribed there), so I am hoping some kindly soul here will help me! Hi developers, In attempting to build psqlodbc from source, I receive the following error in configure after invoking it by /configure --with-unixodbc=/usr/l

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > In response to Tom Lane <[EMAIL PROTECTED]>: >> I'd bet on PHP submitting the query via extended query protocol >> (PQexecParams or equivalent) instead of plain ol PQexec which is what >> psql uses. > Doesn't appear that way. OK, it seemed like a good firs

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Bill Moran
In response to Tom Lane <[EMAIL PROTECTED]>: > Bill Moran <[EMAIL PROTECTED]> writes: > > I'm now full of mystery and wonder. It would appear as if the > > underlying problem has something to do with PHP, but why should this > > cause a backend process to crash? > > I'd bet on PHP submitting the

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Jan de Visser
On Friday 20 July 2007 12:51:47 Tom Lane wrote: > Can someone make a reproducer that uses > PQexecParams? Does JDBC apply? jan -- -- Jan de Visser                     [EMAIL PROTECTED]                 Baruk Khazad! Khazad ai-menu! ---

Re: [GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > I'm now full of mystery and wonder. It would appear as if the > underlying problem has something to do with PHP, but why should this > cause a backend process to crash? I'd bet on PHP submitting the query via extended query protocol (PQexecParams or equiva

[GENERAL] 8.2.4 signal 11 with large transaction

2007-07-20 Thread Bill Moran
The attached PHP script is a derived test case based on an actual problem we've been seeing in our application. The result of this script is a crashed (sig 11) backend on pg 8.2.4. I've now reproduced this on two different systems, a large server with 1G of shared_buffers and many other performa

Re: [GENERAL] Postgres Performance Issue

2007-07-20 Thread Bill Moran
In response to Brian Maguire <[EMAIL PROTECTED]>: > Hi, > > We're trying to figure out why we're getting poor query performance on a > particular database running on a 64 bit Solaris box. The info for the poor > database is: > > Red Hat Enterprise Linux AS release 4 (Nahant Update 2) Linux vl

[GENERAL] Postgres Performance Issue

2007-07-20 Thread Brian Maguire
Hi, We're trying to figure out why we're getting poor query performance on a particular database running on a 64 bit Solaris box. The info for the poor database is: Red Hat Enterprise Linux AS release 4 (Nahant Update 2) Linux vl-sfv40z-001 2.6.9-22.0.2.ELsmp #1 SMP Thu Jan 5 17:11:56 EST 200

Re: [GENERAL] several postgres installations on the same machine?

2007-07-20 Thread Zlatko Matić
I followed instructions from the blog, but when applying initdb command I have the following error: "initdb: file "C:/Program Files/PostgreSQL/8.2/share/postgres.bki" does not exist. This means you have a corrupted installation or identified the wrong directory with the invocation option -L.".

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
On Jul 20, 2007, at 9:06 AM, Michael Fuhr wrote: On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: I want to do something like this: ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id FOREIGN KEY (item_id, 'Company') REFERENCES item_bases(item_id, it

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Michael Fuhr
On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: > I want to do something like this: > > ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id > FOREIGN KEY (item_id, 'Company') > REFERENCES item_bases(item_id, item_type) > INITIALLY DEFERRED

[GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
I want to do something like this: ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id FOREIGN KEY (item_id, 'Company') REFERENCES item_bases(item_id, item_type) INITIALLY DEFERRED I could add a column to companies that is always set to "Company" but

Re: [GENERAL] Retrieve the record ID

2007-07-20 Thread Kenneth Downs
We have a system that sends back information by using the RAISE NOTICE. I've taken two lines out of it and put them here to illustrate the idea. You may have to play with it to get it right: NotifyList = 'The OID is: ' || CAST(new.oid as varchar(10)) || ';'; RAISE NOTICE '%',NotifyList; Luc

Re: [GENERAL] When is PostgreSQL 8.3 slated for release?

2007-07-20 Thread Tom Allison
Keaton Adams wrote: I am being asked by management when PostgreSQL 8.3 will become generally available. Is there an updated timeline for 8.3? You know the answer is supposed to be "when it's ready" but we all know Management doesn't like that kind of an answer. Of course, you could just p

Re: [GENERAL] CASE in ORDER BY clause

2007-07-20 Thread Tom Allison
Uwe C. Schroeder wrote: On Saturday 07 July 2007, Lew wrote: So if your RDBMS sorts NULLs after all other values, then from select start_date from show_date order by case when start_date > CURRENT_DATE then start_date end desc, case when start_date <= CURRENT_DATE then start_date end asc

Re: [GENERAL] pg_dump without blobs

2007-07-20 Thread Sébastien Boutté
I think i've found a solution, i will do this : CREATE FUNCTION save_bytea_on_system(bytea) RETURNS varchar AS $$ use File::Temp (); $fh = new File::Temp(); binmode($fh); my $data = $_[0]; $data =~ s{\\(\\|[0-7]{3})}{$1 eq "\\" ? $1 : chr(oct($1))}ge; $fname = $fh->filename;

[GENERAL] privillages for pg_class

2007-07-20 Thread Zlatko Matić
Hello. I use following statements for temporarily disable triggers and enable them again: --Disable triggers. UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" = 'orders'; --Enable triggers. UPDATE pg_class SET reltriggers = ( SELECT count(*) FROM pg_trigger where pg_class.oid = tgreli

Re: [GENERAL] Retrieve the record ID

2007-07-20 Thread Shane Ambler
Luca Ciciriello wrote: Hi all. I'm new to this list and, first of all, I'm a new user of PostgreSQL. The version I'm using is 8.2.3 and I've the necessity to retrieve, using an application, the ID of a modified (INSERT, UPDATE, DELETE) record of a triggered table. I wasn't able to find out a way

[GENERAL] Retrieve the record ID

2007-07-20 Thread Luca Ciciriello
Hi all. I'm new to this list and, first of all, I'm a new user of PostgreSQL. The version I'm using is 8.2.3 and I've the necessity to retrieve, using an application, the ID of a modified (INSERT, UPDATE, DELETE) record of a triggered table. I wasn't able to find out a way to obtain the required I

Re: [GENERAL] several postgres installations on the same machine?

2007-07-20 Thread Richard Huxton
Zlatko Matić wrote: Hi. If I understood correctly, this blog describes how to create second instance that is linked to first (the same service acount user)? But, I want to know whether it is possible to have second instance completely independent, not influencing each other? Yes, just make sure

Re: [GENERAL] several postgres installations on the same machine?

2007-07-20 Thread Magnus Hagander
On Fri, Jul 20, 2007 at 09:24:05AM +0200, Zlatko Matić wrote: > Hi. > If I understood correctly, this blog describes how to create second instance > that is linked to first (the same service acount user)? > But, I want to know whether it is possible to have second instance completely > independen

Re: [GENERAL] several postgres installations on the same machine?

2007-07-20 Thread Pavel Stehule
Hello PostgreSQL can run with more independent clusters. These clusters can be related to one binary files or to more (different versions of postgresql) files. Every cluster has own configuration. Databases from one cluster share users, locales, etc. Windows installer build first cluster automa

Re: [GENERAL] several postgres installations on the same machine?

2007-07-20 Thread Zlatko Matić
Hi. If I understood correctly, this blog describes how to create second instance that is linked to first (the same service acount user)? But, I want to know whether it is possible to have second instance completely independent, not influencing each other? Regards, Zlatko - Original Message