[GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Thomas
Hi, I have jumped from MySQL to PostgreSQL, and I wanted to know how we declare that a table depends on another one. Currently I have 3 tables: Product(id, title, price) Item(id, product_id, order_id, quantity) Order(id, amount, paid) In pgAdmin I have removed a few order entries, but the items

Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread hubert depesz lubaczewski
On Sun, Oct 26, 2008 at 10:44:29AM +0100, Thomas wrote: > In pgAdmin I have removed a few order entries, but the items > associated to them are still here, now I have zombie items floating > around that don't belong to any order. So how do I tell PgSQL that > when I remove a given order, it should

Re: [GENERAL] a LEFT JOIN problem

2008-10-26 Thread Thomas
Hi Tony, You nailed it! That's the piece of the puzzle I was missing. Moving the filtering inside the ON clause was the solution. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Thomas
Super! Thank you Hubert and Niklas. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Niklas Johansson
On 26 okt 2008, at 10.44, Thomas wrote: Currently I have 3 tables: Product(id, title, price) Item(id, product_id, order_id, quantity) Order(id, amount, paid) So how do I tell PgSQL that when I remove a given order, it should remove all associated items also? Use a foreign key constraint with

Re: [GENERAL] support for embedded db and a clustered index?

2008-10-26 Thread Paul Bohme
Scott Marlowe wrote: Also, can pgsql be embedded in an application? By that I mean it is easily deployable with an application. Not really the same thing. PostgreSQL is not embeddable in the classic sense, and if you need an embedded database, look at SQLLite. ... I do NOT mean a

Re: [GENERAL] again...

2008-10-26 Thread Jeff
- Original Message - From: "Scott Marlowe" <[EMAIL PROTECTED]> To: "Ati Rosselet" <[EMAIL PROTECTED]> Cc: Sent: Saturday, October 25, 2008 12:04 PM Subject: Re: [GENERAL] again... On Sat, Oct 25, 2008 at 9:12 AM, Ati Rosselet <[EMAIL PROTECTED]> wrote: I'm still getting a lot of th

[GENERAL] Are there plans to add data compression feature to postgresql?

2008-10-26 Thread 小波 顾
_ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Re: [GENERAL] again...

2008-10-26 Thread Martin Gainty
good suggestion jeff I would also add starting postgres with log_connections=on postgres -c log_connections=on check postgressql.cong logdirectory log_destination = '/fubar' just to make sure you have permission to write to fubar.. HTH Martin __ Dis

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-10-26 Thread Scott Marlowe
On Sun, Oct 26, 2008 at 9:54 AM, 小波 顾 <[EMAIL PROTECTED]> wrote: > Are there plans to add data compression feature to postgresql? There already is data compression in postgresql. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://ww

Re: [GENERAL] syncing with a MySQL DB

2008-10-26 Thread Jonah H. Harris
On Sat, Oct 25, 2008 at 1:19 PM, Ernesto Quiñones <[EMAIL PROTECTED]> wrote: > I use dbi-link, work fine, but I have problems when I call mysql > tables "linked" and these tables are big, maybe a millon records, the > answers is really slow, I need to wait 5 or more minutes to have an > answer in a

Re: [GENERAL] syncing with a MySQL DB

2008-10-26 Thread David Fetter
On Sun, Oct 26, 2008 at 12:41:39PM -0400, Jonah H. Harris wrote: > On Sat, Oct 25, 2008 at 1:19 PM, Ernesto Quiñones <[EMAIL PROTECTED]> wrote: > > I use dbi-link, work fine, but I have problems when I call mysql > > tables "linked" and these tables are big, maybe a millon records, > > the answers

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-10-26 Thread Martin Gainty
Scott- Straight from Postgres doc The zlib compression library will be used by default. If you don't want to use it then you must specify the --without-zlib option for configure. Using this option disables support for compressed archives in pg_dump and pg_restore. Martin

Re: [GENERAL] Are there plans to add data compression feature to postgresql?

2008-10-26 Thread Scott Marlowe
2008/10/26 Martin Gainty <[EMAIL PROTECTED]>: > Scott- > > Straight from Postgres doc > The zlib compression library will be used by default. If you don't want to > use it then you must specify the --without-zlib option for configure. Using > this option disables support for compressed archives in

Re: [GENERAL] again... (win32 logging errors)

2008-10-26 Thread Klint Gore
Ati Rosselet wrote: I'm still getting a lot of these entries in my eventlog whenever I have a reasonably large amount of logging: Event Type:Error Event Source:PostgreSQL Event Category:None Event ID:0 Date:10/22/2008 Time:9:36:28 AM User:N/A Computer:

Re: [GENERAL] again... (win32 logging errors)

2008-10-26 Thread Martin Gainty
Agreed! make SURE the user you used to login has rights cmd cacls LogFileName HTH Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a con

[GENERAL] [PLPGSQL] PERFORM into an EXECUTE allowed ?

2008-10-26 Thread Bruno Baguette
Hello ! I'm trying to build a PL/PGSQL function trigger. When the function is triggered, PostgreSQL complains about an error at or near PEFORM. Here's the piece of code : EXECUTE 'PERFORM COUNT(*)' || ' FROM ' || quote_ident(TG_RELNAME) || ' GROUP BY ' || quote_ident(column_name_to

Re: [GENERAL] [PLPGSQL] PERFORM into an EXECUTE allowed ?

2008-10-26 Thread Tom Lane
Bruno Baguette <[EMAIL PROTECTED]> writes: > EXECUTE 'PERFORM COUNT(*)' > || ' FROM ' || quote_ident(TG_RELNAME) > || ' GROUP BY ' || quote_ident(column_name_to_check) > || ' HAVING COUNT(*) > 1'; PERFORM is a plpgsql keyword, not a SQL keyword, so it's not surprising that this f