Re: "NOT NULL" - Mailing list pgsql-novice

From Jan B.
Subject Re: "NOT NULL"
Date
Msg-id 429307CB.3060100@monso.de
Whole thread Raw
In response to Re: "NOT NULL"  (tövis <tovises@freemail.hu>)
List pgsql-novice
If your RAD (I don't know what this means at all) does not allow the
keyword "DEFAULT" you might probably use this:

INSERT INTO some_table (second_field_name, third_field_name) VALUES
(second_field_value, third_field_value);

If you not mention first_field_name in the first parenthesis, the
default value will be used.

The reference for INSERT can give you further syntax details:
http://www.postgresql.org/docs/8.0/interactive/sql-insert.html


Jan Behrens


tövis wrote:

> Problem is evolving;o(
>
> When I'm using a sequence for table PRIMARY KEY, where I never ever
> want to give a value myself to this field I've should provide DEFAULT
> expression...
> INSERT INTO some_table VALUES (DEFAULT,second_field,third_field,...);
> But my lovely RAD (Clarion 6.1) does not allow this because of the
> type is a LONG - INTEGER (4 byte).
> I found a simple work around, define for RAD this value as STRING(16)
> - and I can give value 'DEFAULT' - it is working.
> Is there possibility to define for server that if it gets NULL or ZERO
> value for this field use default value - next from sequence - which is
> work well if you does not define "NOT NULL" or "PRIMARY KEY"
> constraint for this field?
> Thanks in advance
>    Tövis
>

pgsql-novice by date:

Previous
From: tövis
Date:
Subject: Re: "NOT NULL"
Next
From: Bendik Rognlien Johansen
Date:
Subject: Re: [despammed] Trigger unhappy