Re:

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re:
Date: 2002-08-06 19:02:57
Message-ID: 1028660577.4167.17.camel@rebel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, 2002-08-05 at 16:51, steven_pannel(at)yahoo(dot)com wrote:
> Just a quick, silly question about something that has
> been driving me insane for the past 20 minutes: why
> does the following generate an error in postgresql
> 6.5?
>
> create table test2(city varchar(35) NULL );
>
> I am using a program which is supposed to work with
> postgresql as a database backend but it generates
> queries like that which seem to fail on postgresql
> 6.5. The error is
>
> ERROR: parser: parse error at or near "null"
>
> (NOT NULL instead of NULL works fine btw)
>
> Is this only supposed to work in the newer versions or
> is the query just plain wrong in any version of
> postgresql?

What is your goal? To make NULL the default value of city?
Specifying NOT NULL is an implicit field constraint saying
that city can not be NULL. So, I'd guess that pg is thinking,
"does he really only want the values to be NULL", thinking
that that doesn't make sense, and then puking.

--
+-----------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron(dot)l(dot)johnson(at)cox(dot)net |
| Jefferson, LA USA |
| |
| "The greatest dangers to liberty lurk in insidious encroachment |
| by men of zeal, well-meaning, but without understanding." |
| Justice Louis Brandeis, dissenting, Olmstead v US (1928) |
+-----------------------------------------------------------------+

In response to

  • at 2002-08-05 21:51:19 from steven_pannel

Browse pgsql-novice by date

  From Date Subject
Next Message James Kelty 2002-08-06 20:00:04 File size limit on pg_dumpall
Previous Message Sugrue, Sean 2002-08-06 18:12:52