public inbox for [email protected]help / color / mirror / Atom feed
ALTER TABLE doc small thing 4+ messages / 3 participants [nested] [flat]
* ALTER TABLE doc small thing @ 2011-05-09 15:56 Grzegorz Szpetkowski <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Grzegorz Szpetkowski @ 2011-05-09 15:56 UTC (permalink / raw) To: pgsql-docs 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. ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: ALTER TABLE doc small thing @ 2011-05-09 18:12 Grzegorz Szpetkowski <[email protected]> parent: Grzegorz Szpetkowski <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Grzegorz Szpetkowski @ 2011-05-09 18:12 UTC (permalink / raw) To: pgsql-docs "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 <referential constraint definition> for that referential constraint, or if the referencing table has more than one specified column for that <referential constraint definition>, but none of those columns is nullable, then the effect is the same as if no <match type> 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 <[email protected]>: > 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. > ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: ALTER TABLE doc small thing @ 2011-05-19 20:19 Robert Haas <[email protected]> parent: Grzegorz Szpetkowski <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Robert Haas @ 2011-05-19 20:19 UTC (permalink / raw) To: Grzegorz Szpetkowski <[email protected]>; +Cc: pgsql-docs On Mon, May 9, 2011 at 2:12 PM, Grzegorz Szpetkowski <[email protected]> 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 <referential constraint definition> for that > referential constraint, or if the referencing table has more than one > specified column for that <referential constraint definition>, but > none of those columns is nullable, then the effect is the same as if > no > <match type> 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 ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: ALTER TABLE doc small thing @ 2011-09-10 13:24 Bruce Momjian <[email protected]> parent: Robert Haas <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Bruce Momjian @ 2011-09-10 13:24 UTC (permalink / raw) To: Robert Haas <[email protected]>; +Cc: Grzegorz Szpetkowski <[email protected]>; pgsql-docs Robert Haas wrote: > On Mon, May 9, 2011 at 2:12 PM, Grzegorz Szpetkowski > <[email protected]> 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 <referential constraint definition> for that > > referential constraint, or if the referencing table has more than one > > specified column for that <referential constraint definition>, but > > none of those columns is nullable, then the effect is the same as if > > no > > <match type> 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 <[email protected]> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-09-10 13:24 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2011-05-09 15:56 ALTER TABLE doc small thing Grzegorz Szpetkowski <[email protected]> 2011-05-09 18:12 ` Grzegorz Szpetkowski <[email protected]> 2011-05-19 20:19 ` Robert Haas <[email protected]> 2011-09-10 13:24 ` Bruce Momjian <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox