On Saturday 11 August 2007 12:28:45 Pavel Stehule wrote:
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
looks strange to me too, but i never had foreign keys to the same table.
it works if you define your chekced_by FK deferrable with
checked_by INT REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL
DEFERRABLE INITIALLY DEFERRED,
it seams that postgresql does its job in a procedural
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,
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 to
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.=) worker
This says you
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
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 work with
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 worker =
NULL WHERE $1
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
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, as I'd
10 matches
Mail list logo