Re: ALTER TABLE doc small thing

Поиск
Список
Период
Сортировка
Искать

Re: ALTER TABLE doc small thing

От:
Grzegorz Szpetkowski <gszpetkowski@gmail.com>
Дата:
"NOTE 30 — If MATCH FULL or MATCH PARTIAL is specified for a
referential constraint and if the referencing table has only one
column specified in  for that
referential constraint, or if the referencing table has more than one
specified column for that , but
none of those columns is nullable, then the effect is the same as if
no
 were specified."

I found that in SQL:2003 draft, so in above case MATCH FULL is
syntactically ok, but rather confusing and effectively do nothing
(maybe just impression purpose).

Regards,
G. Sz.

2011/5/9 Grzegorz Szpetkowski :
> http://www.postgresql.org/docs/9.0/static/sql-altertable.html
>
> "To add a foreign key constraint to a table:
>
> ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address)
> REFERENCES addresses (address) MATCH FULL;"
>
> This looks confusing to me. Is "MATCH FULL" works with non-composite
> (one adress column) foreign keys at all ?
>
> Regards,
> G. Sz.
>

Re: ALTER TABLE doc small thing

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Mon, May 9, 2011 at 2:12 PM, Grzegorz Szpetkowski
 wrote:
> "NOTE 30 — If MATCH FULL or MATCH PARTIAL is specified for a
> referential constraint and if the referencing table has only one
> column specified in  for that
> referential constraint, or if the referencing table has more than one
> specified column for that , but
> none of those columns is nullable, then the effect is the same as if
> no
>  were specified."
>
> I found that in SQL:2003 draft, so in above case MATCH FULL is
> syntactically ok, but rather confusing and effectively do nothing
> (maybe just impression purpose).

I guess we could remove it, but I don't think it's really doing any harm.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: ALTER TABLE doc small thing

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Robert Haas wrote:
> On Mon, May 9, 2011 at 2:12 PM, Grzegorz Szpetkowski
>  wrote:
> > "NOTE 30 ? If MATCH FULL or MATCH PARTIAL is specified for a
> > referential constraint and if the referencing table has only one
> > column specified in  for that
> > referential constraint, or if the referencing table has more than one
> > specified column for that , but
> > none of those columns is nullable, then the effect is the same as if
> > no
> >  were specified."
> >
> > I found that in SQL:2003 draft, so in above case MATCH FULL is
> > syntactically ok, but rather confusing and effectively do nothing
> > (maybe just impression purpose).
> 
> I guess we could remove it, but I don't think it's really doing any harm.

I find the MATCH FULL makes the example less real-world accurate, so I
removed the specification from the example.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
FAQ