CREATE TABLE docs fix
This patch fixes a minor inaccuracy in the documentation: NOT NULL is
not synonymous with CHECK (xxx IS NOT NULL) -- for example, consider
ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL', not a check
constraint.
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
Attachments:
create_table_docs.patchtext/x-patchDownload+4-4
On Sun, 2002-09-01 at 04:00, Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL is
not synonymous with CHECK (xxx IS NOT NULL) -- for example, consider
ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL', not a check
constraint.
Yeah, but they're still synonymous.
Rod Taylor <rbt@zort.ca> writes:
On Sun, 2002-09-01 at 04:00, Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL
is not synonymous with CHECK (xxx IS NOT NULL) -- for example,
consider ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL',
not a check constraint.Yeah, but they're still synonymous.
How so? Their behavior is clearly different (note the case above, as
well as any other situation in which the system attempts to determine
if a column allows a NULL value).
Since they are not interchangeable, they can't be synonyms.
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
On Sun, 2002-09-01 at 13:28, Neil Conway wrote:
Rod Taylor <rbt@zort.ca> writes:
On Sun, 2002-09-01 at 04:00, Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL
is not synonymous with CHECK (xxx IS NOT NULL) -- for example,
consider ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL',
not a check constraint.Yeah, but they're still synonymous.
How so? Their behavior is clearly different (note the case above, as
well as any other situation in which the system attempts to determine
if a column allows a NULL value).Since they are not interchangeable, they can't be synonyms.
The case you brought up is more of a bug or mis-implementation of alter
table / add primary key. I guess you're right. They're not, but they
should be.
En 01 Sep 2002 13:44:37 -0400
Rod Taylor <rbt@zort.ca> escribi�:
On Sun, 2002-09-01 at 04:00, Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL
is not synonymous with CHECK (xxx IS NOT NULL) -- for example,
consider ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL',
not a check constraint.The case you brought up is more of a bug or mis-implementation of alter
table / add primary key. I guess you're right. They're not, but they
should be.
I think it's very difficult in the general case to determine from a
CHECK constraint if it is setting some column to not null; but if it was
easy, then you better translate(*) it into the SET NOT NULL form, and leave
the ADD PRIMARY KEY code alone.
Anyway IMHO this should be documented to prevent possible confusion.
(*) but I think auto-converting some things into some other things that
may not be what the user wants is a recipe for user frustration.
--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El sabio habla porque tiene algo que decir;
el tonto, porque tiene que decir algo" (Platon).
Is this patch to be applied?
---------------------------------------------------------------------------
Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL is
not synonymous with CHECK (xxx IS NOT NULL) -- for example, consider
ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL', not a check
constraint.Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
--
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, Pennsylvania 19073
Attachments:
/bjm/doctext/plainDownload+4-4
Bruce Momjian <pgman@candle.pha.pa.us> writes:
Is this patch to be applied?
Yes, IMHO anyway.
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
Your patch has been added to the PostgreSQL unapplied patches list at:
http://207.106.42.251/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
---------------------------------------------------------------------------
Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL is
not synonymous with CHECK (xxx IS NOT NULL) -- for example, consider
ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL', not a check
constraint.Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
--
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, Pennsylvania 19073
Patch applied. Thanks.
---------------------------------------------------------------------------
Neil Conway wrote:
This patch fixes a minor inaccuracy in the documentation: NOT NULL is
not synonymous with CHECK (xxx IS NOT NULL) -- for example, consider
ALTER TABLE ADD PRIMARY KEY, which checks for 'NOT NULL', not a check
constraint.Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
--
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, Pennsylvania 19073