Re: ENABLE/DISABLE CONSTRAINT NAME
От | Bernd Helmle |
---|---|
Тема | Re: ENABLE/DISABLE CONSTRAINT NAME |
Дата | |
Msg-id | BB11006AFB4CF43C55C89345@apophis.credativ.lan обсуждение исходный текст |
Ответ на | Re: ENABLE/DISABLE CONSTRAINT NAME (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: ENABLE/DISABLE CONSTRAINT NAME
Re: ENABLE/DISABLE CONSTRAINT NAME |
Список | pgsql-hackers |
--On 13. September 2013 20:17:19 -0400 Robert Haas <robertmhaas@gmail.com> wrote: > You're missing the point. Peter wasn't worried that your patch throws > an error; he's concerned about the fact that it doesn't. > > In PostgreSQL, you can only create the following view because test1 > has a primary key over column a: > > => create table test1 (a int constraint pk primary key, b text); > => create view test2 as select a, b from test1 group by a; > => alter table test1 drop constraint pk; > > The reason that, if the primary key weren't there, it would be > ambiguous which row should be returned as among multiple values where > a is equal and b is not. If you can disable the constraint, then you > can create precisely that problem. Hmm not sure i understand this argument either: this patch doesn't allow disabling a primary key. It only supports FKs and CHECK constraints explicitly. -- Thanks Bernd
В списке pgsql-hackers по дате отправления: