Re: set constraints docs page

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: set constraints docs page
Дата
Msg-id 200308260357.h7Q3vnt29250@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: set constraints docs page  (Kevin Brown <kevin@sysexperts.com>)
Ответы Re: set constraints docs page  (Kevin Brown <kevin@sysexperts.com>)
Список pgsql-hackers
Kevin Brown wrote:
> Tom Lane wrote:
> > "Andrew Dunstan" <andrew@dunslane.net> writes:
> > >> I object to creating gratuitous incompatibilities with the SQL standard,
> > >> which will obstruct legitimate features down the road.  The SQL standard
> > >> says it is <schema>.<constraint>.
> > 
> > > Is there a case for enforcing uniqueness on constraint names, then?
> > 
> > Other than "SQL92 says so"?  Very little.  This seems to me to be a
> > design error in the spec.  Per-table constraint names are easier to
> > work with --- if they're global across a schema then you have a serious
> > problem avoiding collisions.
> 
> I assume that SQL99 and later don't specify anything different than what
> SQL92 calls for in this regard?
> 
> Without any meaningful guidance from the spec, the best we can do is
> support per-table constraint names and provide optional (via a GUC
> variable) support for SQL92-compliant constraint names.  Let the DBA
> decide which (if not both) is best for his situation.  Inasmuch as
> one of our "selling points" is our compliance with the SQL spec, I see
> little reason to entirely avoid compliance with the spec on this issue --
> just make it possible to do something else when/if necessary.
> 
> The two approaches aren't necessarily mutually exclusive (though SQL99
> compliance on constraint names would obviously make it unnecessary to
> specify a tablename along with a constraint name), so I see little
> problem here.  But the current arrangement is obviously untenable,
> because it allows you to create a situation (multiple constraints by
> the same name) that you can't reasonably extricate yourself from.

Well, it seems if we want to continue to allow the same constraint name
to be used by different tables in the same schema, we have to print the
tablename in the error message.  Would someone actually be looking for a
standards-compliant error string?  We have already extended the standard
--- either we revert that, or we have to go the entire way and print the
table name.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: backwards-compat problem?
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: NOTICE vs WARNING