Re: [GENERAL] virtual database

2007-08-11 Thread Hannes Dorbath
Farhan Mughal wrote: > Does PostgreSQL support a Virtual Database like Oracle? No, but we have 2 external approaches: http://veil.projects.postgresql.org/curdocs/index.html http://www.kaigai.gr.jp/index.php?sepgsql -- Best regards, Hannes Dorbath ---(end of broadcast)-

Re: [GENERAL] SQL question: checking all required items

2007-08-11 Thread Raymond O'Donnell
On 10/08/2007 21:42, Scott Marlowe wrote: Show us the query when you're done, I'm sure there are enough folks who'd like to see your solution. Here's what I came up with: select distinct ip.person_id from items_for_people ip where exists ( ( select item_id from items where

Re: [GENERAL] SQL question: checking all required items

2007-08-11 Thread Raymond O'Donnell
On 10/08/2007 22:03, Carlos Ortíz wrote: Select * from people where person_id in ( Select person_ID from Items_for_people group by Person_id Having Count(*) = ( Select count(*) from Items Where is_required = true)) That seems to work fine! I'd only change "having count(*) = .

Re: [GENERAL] Installing Postgresql 8.2 on Windows Vista

2007-08-11 Thread Hannes Dorbath
Johan Runnedahl wrote: > I would appreciate any constructive help on this. A constructive answer is to grab VMware Server or VirtualBox and a PG LiveCD. That way you are up and running in 15 minutes and can get your work done instead of fighting with an installer / OS combo that is known to be pro

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Pavel Stehule
2007/8/11, Stephan Szabo <[EMAIL PROTECTED]>: > On Sat, 11 Aug 2007, Pavel Stehule wrote: > > > Hello > > > > I found strange postgresql's behave. Can somebody explain it? > > There's a bug since it should work for any number, but we've likely missed > something. I'm not sure why 2 references work,

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Stephan Szabo
On Sat, 11 Aug 2007, Pavel Stehule wrote: > Hello > > I found strange postgresql's behave. Can somebody explain it? There's a bug since it should work for any number, but we've likely missed something. I'm not sure why 2 references work, as I'd expect it to stop working after 1 with the likely ca

Re: [GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-11 Thread Tom Lane
Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > But, I found something fishy that particular server: > uruk:~# hwclock > Sat 11 Aug 2007 10:47:36 AM CEST -0.630123 seconds > uruk:~# hwclock --utc > Sat 11 Aug 2007 12:47:39 PM CEST -0.600430 seconds If this is PC-typ

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Pavel Stehule
2007/8/11, Gregory Stark <[EMAIL PROTECTED]>: > > Sorry, I reread your original post. My initial reading was wrong. > > To make this work I think you'll need to set these constraints to be deferred. > > -- it works with deferred constraints . It's strange, it works with two columns but dowsn't wo

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Gregory Stark
Sorry, I reread your original post. My initial reading was wrong. To make this work I think you'll need to set these constraints to be deferred. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com ---(end of broadcast)--- TIP

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Gregory Stark
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > 2007/8/11, Gregory Stark <[EMAIL PROTECTED]>: >> >> "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> >> > checked_by INT REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET >> > NULL, >> >> > CONTEXT: SQL statement "UPDATE ONLY "public"."tasks" SET

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Pavel Stehule
2007/8/11, Gregory Stark <[EMAIL PROTECTED]>: > > "Pavel Stehule" <[EMAIL PROTECTED]> writes: > > > checked_by INT REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL, > > > CONTEXT: SQL statement "UPDATE ONLY "public"."tasks" SET "worker" = > > NULL WHERE $1 OPERATOR(pg_catalog.=) "worke

Re: [GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Gregory Stark
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > checked_by INT REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL, > CONTEXT: SQL statement "UPDATE ONLY "public"."tasks" SET "worker" = > NULL WHERE $1 OPERATOR(pg_catalog.=) "worker"" This says you mistyped the constraint above to refer

[GENERAL] why it doesn't work? referential integrity

2007-08-11 Thread Pavel Stehule
Hello I found strange postgresql's behave. Can somebody explain it? Regards Pavel Stehule CREATE TABLE users ( id integer NOT NULL, name VARCHAR NOT NULL, PRIMARY KEY (id) ); INSERT INTO users VALUES (1, 'Jozko'); INSERT INTO users VALUES (2, 'Ferko'); INSERT INTO users VALUES (3, 'Samko'

Re: [GENERAL] Are these two creation commands functionally identical?

2007-08-11 Thread Ragnar
On fim, 2007-08-09 at 20:55 +, [EMAIL PROTECTED] wrote: > I want to to know if these two are functionally equivalent. Is this: > > Create table "sales" > ( > "saleid" BigSerial NOT NULL, > "userid" Bigint NOT NULL, > "parent_saleid" Bigint NOT NULL, > primary key ("saleid")

Re: [GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-11 Thread Louis-David Mitterrand
On Fri, Aug 10, 2007 at 04:59:52PM -0400, Tom Lane wrote: > Karsten Hilbert <[EMAIL PROTECTED]> writes: > > On Fri, Aug 10, 2007 at 10:11:29AM +0200, Louis-David Mitterrand wrote: > >> So if I understand correctly, a timestamp_tz is ... > > > ... stored as UTC in the backend > > > ... sent to cli

[GENERAL] Trigger Procedure Error: NEW used in query that is not in a rule

2007-08-11 Thread Javier Fonseca V.
Hello. I'm doing a Trigger Procedure in pl/pgSQL. It makes some kind of auditing. I think that it's working alright except for the next line: EXECUTE 'INSERT INTO ' || quote_ident(somedynamictablename) || ' SELECT new.*'; PostgreSQL keeps telling me: "ERROR: NEW used in query that is not in a