Skip site navigation (1) Skip section navigation (2)

Re: "NOT NULL"

From: "Jan B(dot)" <jan(at)monso(dot)de>
To: tövis <tovises(at)freemail(dot)hu>
Cc: pgsql novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: "NOT NULL"
Date: 2005-05-24 10:54:03
Message-ID: 429307CB.3060100@monso.de (view raw or flat)
Thread:
Lists: 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
>

In response to

Responses

pgsql-novice by date

Next:From: Bendik Rognlien JohansenDate: 2005-05-24 12:33:53
Subject: Re: [despammed] Trigger unhappy
Previous:From: tövisDate: 2005-05-24 10:37:54
Subject: Re: "NOT NULL"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group