Hi guys,

I've been chatting to Tom about implementing the ability to change the NULL
status of a column via SQL.

This is the Oracle syntax:

alter table table_name modify column1 not null;
alter table table_name modify column1 null;

This is the MySQL syntax:

ALTER TABLE asfd CHANGE [COLUMN] old_col_name create_definition [FIRST |
AFTER column_name]
or    ALTER TABLE asfd MODIFY [COLUMN] create_definition [FIRST | AFTER
column_name]

CHANGE col_name, DROP col_name, and DROP INDEX are MySQL extensions to ANSI
SQL92.
MODIFY is an Oracle extension to ALTER TABLE.

So, the question is - what the heck is the standard syntax?  Is there a
standard syntax?  How about this syntax that I came up with:

ALTER TABLE blah ALTER COLUMN col SET [NULL | NOT NULL]

Anyone have any ideas?  Perhaps we should use some sort of 'MODIFY'-like
syntax to enable in the future maybe the ability to change column specs in
more advanced ways (such as column type and size)

If the answer is no, Postgres's parser does not have this syntax enabled,
then I'm going to have to ask someone to implement it for me, and then I can
fill in the actual guts of the function - whereever that may be.  (I don't
know parser stuff!)

Chris


Fri, 15 Feb 2002 09:59:29 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
SET NULL / SET NOT NULL
At 09:59 15/02/02 +0800, Christopher Kings-Lynne wrote:
>
>ALTER TABLE blah ALTER COLUMN col SET [NULL | NOT NULL]
>

I'm not too fond of 'SET NULL' - the syntax implies the column is being set
to NULL. But I agree with the rest given we already have ALTER
TABLE...ALTER COLUMN, I'd vote for:

    ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Thu, 21 Feb 2002 13:12:19 +1100
Philip Warner <pjw@rhyme.com.au>
Re: SET NULL / SET NOT NULL
Philip Warner <pjw@rhyme.com.au> writes:

> I'm not too fond of 'SET NULL' - the syntax implies the column is being set
> to NULL. But I agree with the rest given we already have ALTER
> TABLE...ALTER COLUMN, I'd vote for:
> 
>     ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]

FWIW, I like this syntax too.

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

20 Feb 2002 21:18:49 -0500
Doug McNaught <doug@wireboard.com>
Re: SET NULL / SET NOT NULL
> > I'm not too fond of 'SET NULL' - the syntax implies the column
> is being set
> > to NULL. But I agree with the rest given we already have ALTER
> > TABLE...ALTER COLUMN, I'd vote for:
> >
> >     ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]
>
> FWIW, I like this syntax too.

Let's say, theoretically, that in the future we want to allow people to
change the type of their columns, plus allow them to change the nullability.

Should we come up with a syntax for changing nullability that allows for the
future changing of column type?  If so, then a syntaxes like these might be
the way to go:

ALTER TABLE blah ALTER COLUMN col DROP DEFAULT;
ALTER TABLE blah ALTER COLUMN col SET DEFAULT 't';
ALTER TABLE blah ALTER COLUMN col NULL;
ALTER TABLE blah ALTER COLUMN col NOT NULL;
ALTER TABLE blah ALTER COLUMN col varchar(50);
ALTER TABLE blah ALTER COLUMN col int4 NULL;
ALTER TABLE blah ALTER COLUMN col text NOT NULL;

If we just allow the full col spec we could one day support this:

ALTER TABLE blah ALTER COLUMN col text boolean NOT NULL DEFAULT 'f';

Which would change the column to that definition (if coercion is possible)
no matter what current definition is...

Is this the eventual goal?  Will this cause shift/reduce errors? will we
need to put the word 'SET' in after 'col'?

Chris


Thu, 21 Feb 2002 10:28:51 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: SET NULL / SET NOT NULL
> >  ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]
> FWIW, I like this syntax too.

What would be the drawbacks to having all portions after "col" in the
example above be *exactly* the same as the clauses allowed in CREATE
TABLE? So, this would be

  ALTER TABLE tab ALTER COLUMN col [ NULL | NOT NULL ]

The syntax would then be entirely predictable if you knew what you would
have written if you had set the constraint during table creation. I'll
agree (if someone points it out) that this particular example is pretty
terse.

In that same line of thought, how about making it more closely mimic the
original CREATE TABLE syntax? Something like

  ALTER TABLE t (c1 NULL)

Hmm. Or if we are going to eventually allow altering column types then
one could include the type also. That may be a bit much, but having an
idea of what *that* syntax might be could help on manipulating other
column attributes too...

                    - Thomas

Wed, 20 Feb 2002 18:34:06 -0800
Thomas Lockhart <lockhart@fourpalms.org>
Re: SET NULL / SET NOT NULL
(our mail crossed in the ether...)

> Let's say, theoretically, that in the future we want to allow people to
> change the type of their columns, plus allow them to change the nullability.

Right.

> Should we come up with a syntax for changing nullability that allows for the
> future changing of column type?  If so, then a syntaxes like these might be
> the way to go:

Yup.

> If we just allow the full col spec we could one day support this:
> ALTER TABLE blah ALTER COLUMN col text boolean NOT NULL DEFAULT 'f';
> Which would change the column to that definition (if coercion is possible)
> no matter what current definition is...

Right. No point in *precluding* that with a short-sighted choice of
syntax.

> Is this the eventual goal?  Will this cause shift/reduce errors? will we
> need to put the word 'SET' in after 'col'?

Probably not, if we can already do this with CREATE TABLE.

And if we head this direction, then choosing a syntax which most closely
mimics the current CREATE TABLE will allow altering two columns at once,
which would be more efficient presumably than doing one column at a
time.

                    - Thomas

Wed, 20 Feb 2002 18:40:36 -0800
Thomas Lockhart <lockhart@fourpalms.org>
Re: SET NULL / SET NOT NULL
At 18:34 20/02/02 -0800, Thomas Lockhart wrote:
>> >  ALTER TABLE blah ALTER COLUMN col [ALLOW NULL | NOT NULL]
>> FWIW, I like this syntax too.
>
>What would be the drawbacks to having all portions after "col" in the
>example above be *exactly* the same as the clauses allowed in CREATE
>TABLE? So, this would be
>
>  ALTER TABLE tab ALTER COLUMN col [ NULL | NOT NULL ]

This looks fine to me. The spec only talks about CHECK constraints in ALTER
TABLE, but if I had to guess the most spec-like syntax, it would be:

  ALTER TABLE tab ALTER COLUMN col DROP NOT NULL

which does not seem particularly good; preserving the syntax from table
creation has to be TWTG. Do we really allow:

	CREATE TABLE FOO(BAR INT NULL)

?


>In that same line of thought, how about making it more closely mimic the
>original CREATE TABLE syntax? Something like

Because the SQL spec does have ALTER TABLE...ALTER COLUMN; so we should
stick with the same syntax.


>Hmm. Or if we are going to eventually allow altering column types then
>one could include the type also.

Definitely; Chris' suggestion seems pretty good to me.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Thu, 21 Feb 2002 14:18:19 +1100
Philip Warner <pjw@rhyme.com.au>
Re: SET NULL / SET NOT NULL
At 10:28 21/02/02 +0800, Christopher Kings-Lynne wrote:
>
>ALTER TABLE blah ALTER COLUMN col DROP DEFAULT;
>ALTER TABLE blah ALTER COLUMN col SET DEFAULT 't';
>ALTER TABLE blah ALTER COLUMN col NULL;
>ALTER TABLE blah ALTER COLUMN col NOT NULL;
>ALTER TABLE blah ALTER COLUMN col varchar(50);
>ALTER TABLE blah ALTER COLUMN col int4 NULL;
>ALTER TABLE blah ALTER COLUMN col text NOT NULL;

Looks good.


>will we need to put the word 'SET' in after 'col'?

The spec only uses SET for the DEFAULT clause.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Thu, 21 Feb 2002 14:21:18 +1100
Philip Warner <pjw@rhyme.com.au>
Re: SET NULL / SET NOT NULL
>   ALTER TABLE tab ALTER COLUMN col DROP NOT NULL
>
> which does not seem particularly good; preserving the syntax from
table
> creation has to be TWTG. Do we really allow:
>
> CREATE TABLE FOO(BAR INT NULL)

Certainly does.  I depend on that ability to override the standard
NULL / NOT NULL constraint that the domain may have to account for the
exception to the rule.

Actually, is that proper?  Equally easy to disallow overrides, but
(since the books I have don't say) it seemed useful for people with
funny circumstances (like wanting to log a miss as well a hit).


Wed, 20 Feb 2002 22:38:01 -0500
"Rod Taylor" <rbt@zort.ca>
Re: SET NULL / SET NOT NULL
The SQL spec will not help us here, since it doesn't define such a
capability AFAICT.  We might do worse than to look at Or*cle's
implementation, which appears to involve a MODIFY keyword.

I find this in the Or*cle 8i documentation examples:

	The following statement alters the EMP table and defines and
	enables a NOT NULL constraint on the SAL column:

	ALTER TABLE emp 
	   MODIFY (sal  NUMBER  CONSTRAINT nn_sal NOT NULL); 

The docs are opaque enough that I can't actually figure out a BNF
definition for ALTER TABLE MODIFY, and I don't have a working
installation to experiment against.  Can any Or*cle users here
enlighten us?

			regards, tom lane

Wed, 20 Feb 2002 22:47:58 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: SET NULL / SET NOT NULL 
> The SQL spec will not help us here, since it doesn't define such a
> capability AFAICT.  We might do worse than to look at Or*cle's
> implementation, which appears to involve a MODIFY keyword.
>
> I find this in the Or*cle 8i documentation examples:
>
> 	The following statement alters the EMP table and defines and
> 	enables a NOT NULL constraint on the SAL column:
>
> 	ALTER TABLE emp
> 	   MODIFY (sal  NUMBER  CONSTRAINT nn_sal NOT NULL);
>
> The docs are opaque enough that I can't actually figure out a BNF
> definition for ALTER TABLE MODIFY, and I don't have a working
> installation to experiment against.  Can any Or*cle users here
> enlighten us?

I've already posted the Oracle and MSSQL spec to the list here - just check
one of my earlier posts with this subject...

A good place to ask questions is comp.databases.oracle.misc

Chris


Thu, 21 Feb 2002 11:52:56 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: SET NULL / SET NOT NULL 
Christopher Kings-Lynne writes:

> Should we come up with a syntax for changing nullability that allows for the
> future changing of column type?  If so, then a syntaxes like these might be
> the way to go:
>
> ALTER TABLE blah ALTER COLUMN col DROP DEFAULT;
> ALTER TABLE blah ALTER COLUMN col SET DEFAULT 't';

This is standard.

> ALTER TABLE blah ALTER COLUMN col NULL;
> ALTER TABLE blah ALTER COLUMN col NOT NULL;

This is missing a verb.  It can be read as "alter table blah, in
particular, alter column col, (and do what with?) NULL".  Is the NULL part
of the identity of the column?

Using the standard precedent above, how about

ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
ALTER TABLE blah ALTER COLUMN col DROP NOT NULL;

This also avoids the confusing "NULL constraint", which does not say that
the column has to be NULL.

> ALTER TABLE blah ALTER COLUMN col varchar(50);

Here again, there should probably be at least one more word inserted, like
TYPE.

> If we just allow the full col spec we could one day support this:
>
> ALTER TABLE blah ALTER COLUMN col text boolean NOT NULL DEFAULT 'f';

Maybe ... ALTER COLUMN col TO text ...

> Is this the eventual goal?  Will this cause shift/reduce errors? will we
> need to put the word 'SET' in after 'col'?

A shift/reduce conflict has never stopped us. ;-)

-- 
Peter Eisentraut   peter_e@gmx.net


Thu, 21 Feb 2002 20:19:29 -0500 (EST)
Peter Eisentraut <peter_e@gmx.net>
Re: SET NULL / SET NOT NULL
Peter Eisentraut <peter_e@gmx.net> writes:
> Using the standard precedent above, how about

> ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> ALTER TABLE blah ALTER COLUMN col DROP NOT NULL;

This seems like a good choice if we are not too concerned about
compatibility with other DBMSes.  (Which, for something like this,
I'm not; how many applications will be issuing programmed commands
like this?)

			regards, tom lane

Thu, 21 Feb 2002 21:56:07 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: SET NULL / SET NOT NULL 
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Using the standard precedent above, how about
> 
> > ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> > ALTER TABLE blah ALTER COLUMN col DROP NOT NULL;
> 
> This seems like a good choice if we are not too concerned about
> compatibility with other DBMSes.  (Which, for something like this,
> I'm not; how many applications will be issuing programmed commands
> like this?)

Yes, I like this too;  the SET/DROP symetry.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 21 Feb 2002 22:02:04 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: SET NULL / SET NOT NULL
My 2.2c worth (0.2c GST included):
The MySQL approach is a pain because it effectively makes you define a
field from scratch. You have to know and include all the field
attributes instead of just changing the attribute you want.

The attribute definition should be the same as used in create.

If the SQL standard does not have an appropriate facility, submit
yours as an enhancement. They can only say yes, no, or that they have
something already in the pipeline and then you can implement their
proposed standard.

Peter

On Thu, 21 Feb 2002 01:15:15 +0000 (UTC), chriskl@familyhealth.com.au
("Christopher Kings-Lynne") wrote:

>Hi guys,
>
>I've been chatting to Tom about implementing the ability to change the NULL
>status of a column via SQL.
>
>This is the Oracle syntax:
>
>alter table table_name modify column1 not null;
>alter table table_name modify column1 null;
>
>This is the MySQL syntax:
>
>ALTER TABLE asfd CHANGE [COLUMN] old_col_name create_definition [FIRST |
>AFTER column_name]
>or    ALTER TABLE asfd MODIFY [COLUMN] create_definition [FIRST | AFTER
>column_name]
>
>CHANGE col_name, DROP col_name, and DROP INDEX are MySQL extensions to ANSI
>SQL92.
>MODIFY is an Oracle extension to ALTER TABLE.
>
>So, the question is - what the heck is the standard syntax?  Is there a
>standard syntax?  How about this syntax that I came up with:
>
>ALTER TABLE blah ALTER COLUMN col SET [NULL | NOT NULL]
>
>Anyone have any ideas?  Perhaps we should use some sort of 'MODIFY'-like
>syntax to enable in the future maybe the ability to change column specs in
>more advanced ways (such as column type and size)
>
>If the answer is no, Postgres's parser does not have this syntax enabled,
>then I'm going to have to ask someone to implement it for me, and then I can
>fill in the actual guts of the function - whereever that may be.  (I don't
>know parser stuff!)
>
>Chris
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster


Fri, 22 Feb 2002 03:37:15 GMT
peter@helpnet_BUT_NOT_SPAM.com.au
Re: SET NULL / SET NOT NULL
Hi,

I'm halfway thru implementing setting a column's nullness (I've done
changing to null,
but not changing to not null)

Peter E. said:

> Using the standard precedent above, how about
>
> ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> ALTER TABLE blah ALTER COLUMN col DROP NOT NULL;

Do we want the above syntax, or this syntax:

ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
ALTER TABLE blah ALTER COLUMN col SET NULL;

The former sort of treats it like a contraint, where as the latter treats it
as it is during the CREATE TABLE statement.

Say in the future we want to support changing column type as well.  How
would we work that in?

ALTER TABLE blah ALTER COLUMN col SET int4;  ??????

Then we should allow people to do this:

ALTER TABLE blah ALTER COLUMN col SET int4 NULL DEFAULT '3';

So they can change their entire column in one statement.

So really this implies that ALTER COLUMN/SET NULL is the correct syntax,
rather than ALTER COLUMN/DROP NOT NULL.  In fact, maybe we could support
BOTH syntaxes...

Comments?  Let's sort this out before I submit my patch.

Regards,

Chris


Fri, 22 Mar 2002 13:39:45 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: SET NULL / SET NOT NULL
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Say in the future we want to support changing column type as well.  How
> would we work that in?

> ALTER TABLE blah ALTER COLUMN col SET int4;  ??????

Seems one keyword shy of a load; I'd prefer

ALTER TABLE blah ALTER COLUMN col SET TYPE int4;

Otherwise, every keyword that might appear after SET will have to be
fully reserved (else it couldn't be distinguished from a type name).

I like the "SET NULL"/"SET NOT NULL" variant better than SET/DROP, even
though "SET NULL" is perhaps open to misinterpretation.  "DROP NOT NULL"
seems just as confusing for anyone who's not read the documentation :-(

			regards, tom lane

Fri, 22 Mar 2002 00:52:50 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: SET NULL / SET NOT NULL 
> Seems one keyword shy of a load; I'd prefer
>
> ALTER TABLE blah ALTER COLUMN col SET TYPE int4;
>
> Otherwise, every keyword that might appear after SET will have to be
> fully reserved (else it couldn't be distinguished from a type name).

I like that...

So would you then envisage something like this:

ALTER TABLE blah ALTER COLUMN col SET TYPE int4 DEFAULT 3 NOT NULL;

or

ALTER TABLE blah ALTER COLUMN col SET DEFAULT 3 TYPE int4 NULL;

etc.

ie. Order wouldn't matter and you could do them all at once for convenience?
This seems like a cool idea to me.

Problem with all this, of course, is that it's different to everyone else's
syntax, but then they're all different to each other.  There's no standard
for it, but if there's a new standard - I wonder what they would specify?
Since altering a column is a not oft used operation, I would expect that the
punters wouldn't have a problem looking in the docs for how to do it, for
each different DBMS they use...

Chris


Fri, 22 Mar 2002 14:15:35 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: SET NULL / SET NOT NULL 
Tom Lane wrote:
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > Say in the future we want to support changing column type as well.  How
> > would we work that in?
> 
> > ALTER TABLE blah ALTER COLUMN col SET int4;  ??????
> 
> Seems one keyword shy of a load; I'd prefer
> 
> ALTER TABLE blah ALTER COLUMN col SET TYPE int4;
> 
> Otherwise, every keyword that might appear after SET will have to be
> fully reserved (else it couldn't be distinguished from a type name).
> 
> I like the "SET NULL"/"SET NOT NULL" variant better than SET/DROP, even
> though "SET NULL" is perhaps open to misinterpretation.  "DROP NOT NULL"
> seems just as confusing for anyone who's not read the documentation :-(

Yes, DROP NOT NULL does have a weird twist to it.  However, does SET
NULL sound to much like you are setting all the values to NULL?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 22 Mar 2002 01:27:23 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: SET NULL / SET NOT NULL
Christopher Kings-Lynne writes:

> Do we want the above syntax, or this syntax:
>
> ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> ALTER TABLE blah ALTER COLUMN col SET NULL;

My only objection to the second command is that it's plain wrong.  You
don't set anything to NULL, so don't make the command look like it.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 22 Mar 2002 01:31:05 -0500 (EST)
Peter Eisentraut <peter_e@gmx.net>
Re: SET NULL / SET NOT NULL
> > Do we want the above syntax, or this syntax:
> >
> > ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> > ALTER TABLE blah ALTER COLUMN col SET NULL;
> 
> My only objection to the second command is that it's plain wrong.  You
> don't set anything to NULL, so don't make the command look like it.

So then how is it any more wrong than SET NOT NULL?

It should almost be ADD NOT NULL ...

Chris

Fri, 22 Mar 2002 14:34:57 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: SET NULL / SET NOT NULL
On Fri, Mar 22, 2002 at 02:34:57PM +0800, Christopher Kings-Lynne wrote:
> > > Do we want the above syntax, or this syntax:
> > >
> > > ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> > > ALTER TABLE blah ALTER COLUMN col SET NULL;
> > 
> > My only objection to the second command is that it's plain wrong.  You
> > don't set anything to NULL, so don't make the command look like it.
> 
> So then how is it any more wrong than SET NOT NULL?
> 
> It should almost be ADD NOT NULL ...
 
Hmm, there's this SQL92 keyword here: what do people thing of NULLABLE?

SET NOT NULLABLE
SET NULLABLE

Ross

Fri, 22 Mar 2002 00:54:10 -0600
"Ross J. Reedstrom" <reedstrm@rice.edu>
Re: SET NULL / SET NOT NULL
On March 22, 2002 01:31 am, Peter Eisentraut wrote:
> Christopher Kings-Lynne writes:
> > Do we want the above syntax, or this syntax:
> >
> > ALTER TABLE blah ALTER COLUMN col SET NOT NULL;
> > ALTER TABLE blah ALTER COLUMN col SET NULL;
>
> My only objection to the second command is that it's plain wrong.  You
> don't set anything to NULL, so don't make the command look like it.

How about this?

  ALTER TABLE blah ALTER COLUMN col UNSET NOT NULL;

I would almost think that it should be NOTNULL anyway to make it clear that we
are setting (or unsetting) one thing and that it is not a weird way of saying
"...NOT SET NULL" or "NOT UNSET NULL" but I realize that it should also look
more like the NOT NULL clause we already have in the CREATE TABLE query.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

Fri, 22 Mar 2002 07:51:02 -0500
"D'Arcy J.M. Cain" <darcy@druid.net>
Re: SET NULL / SET NOT NULL
Christopher Kings-Lynne writes:

> So then how is it any more wrong than SET NOT NULL?

You're right.

> It should almost be ADD NOT NULL ...

I like that.

It also makes sense because the standard syntax is to ADD/DROP CHECK
constraints, to which NOT NULL constraints are equivalent.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 22 Mar 2002 11:38:27 -0500 (EST)
Peter Eisentraut <peter_e@gmx.net>
Re: SET NULL / SET NOT NULL