Re: [BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread Dean Rasheed
2009/8/11 Tom Lane : > 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 hint would help, a

Re: [BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread Andres Freund
On Tuesday 11 August 2009 19:00:30 Tom Lane wrote: > I wrote: > > Dean Rasheed 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 c

Re: [BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread Tom Lane
I wrote: > Dean Rasheed 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.] > Yeah. Is it worth

Re: [BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread Tom Lane
Dean Rasheed 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 deferrable. So the current

Re: [BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread Dean Rasheed
2009/8/11 hubert depesz lubaczewski : > 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 defe

[BUGS] misleading error message in 8.5, and bad (?) way deferred uniqueness works

2009-08-11 Thread hubert depesz lubaczewski
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 Th

[BUGS] misleading error message

2003-01-23 Thread Hubert depesz Lubaczewski
hi i just spent over 30 minutes trying to discover what was wrong. i was trying to create view: > create view views.session_user as brama-> select 1; ERROR: parser: syntax error at or near "session_user" at character 19 now - i know that session_user is reserver word, but the error message is tot