Re: misleading error message in 8.5, and bad (?) way deferred uniqueness works
| От | Tom Lane |
|---|---|
| Тема | Re: misleading error message in 8.5, and bad (?) way deferred uniqueness works |
| Дата | |
| Msg-id | 10730.1250008830@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: misleading error message in 8.5, and bad (?) way deferred uniqueness works (Dean Rasheed <dean.a.rasheed@googlemail.com>) |
| Ответы |
Re: misleading error message in 8.5, and bad (?) way deferred uniqueness works
|
| Список | pgsql-bugs |
Dean Rasheed <dean.a.rasheed@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 deferrable. So the current
> code can't distinguish between a non-existent unique constraint and a
> non-deferrable one.]
Yeah. Is it worth searching pg_constraint first, just so that we can
give a better error message?
Actually, it strikes me that if we did it that way, we could search
pg_trigger using the constraint OID instead of name, which would permit
replacing the index on tgconstrname with a presumably much smaller one
on tgconstraint. And the bogus rechecks on namespace in
AfterTriggerSetState could probably be simplified too ...
regards, tom lane
В списке pgsql-bugs по дате отправления: