While testing deferred unique constraints I found this:
# CREATE TABLE test (
i INT4 PRIMARY KEY
);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index test_pkey for
table test
CREATE TABLE
# set constraints test_pkey deferred;
ERROR: constraint test_pkey does not exist
The
2009/8/11 hubert depesz lubaczewski dep...@depesz.com:
While testing deferred unique constraints I found this:
# CREATE TABLE test (
i INT4 PRIMARY KEY
);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index test_pkey
for table test
CREATE TABLE
# set constraints test_pkey
Dean Rasheed dean.a.rash...@googlemail.com writes:
The constraint needs to be declared DEFERRABLE before you can defer
it, but yes, I agree this is not a helpful error message.
[The reason is that it actually searches for the trigger enforcing the
constraint, and there isn't one if it's not
I wrote:
Dean Rasheed dean.a.rash...@googlemail.com writes:
[The reason is that it actually searches for the trigger enforcing the
constraint, and there isn't one if it's not deferrable. So the current
code can't distinguish between a non-existent unique constraint and a
non-deferrable one.]
On Tuesday 11 August 2009 19:00:30 Tom Lane wrote:
I wrote:
Dean Rasheed dean.a.rash...@googlemail.com writes:
[The reason is that it actually searches for the trigger enforcing the
constraint, and there isn't one if it's not deferrable. So the current
code can't distinguish between a
2009/8/11 Tom Lane t...@sss.pgh.pa.us:
Anyway it's looking like a slightly nontrivial project. Maybe we should
just rephrase the error message Hubert is complaining about.
Yeah, I can't think of any simple way of distinguishing the 2 error
conditions in that code. Perhaps adding a suitable