Re: how do i insert a default value?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: Andy Kriger <akriger(at)greaterthanone(dot)com>, Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: how do i insert a default value?
Date: 2002-11-12 18:28:27
Message-ID: 10237.1037125707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> writes:
> On Tue, 12 Nov 2002, Andy Kriger wrote:
>> How do you insert a default value in an insert statement that doesn't
>> specify column names? For example, I have a table with 20 columns. I don't
>> want to specify the names in order to skip columns that have default values.

> Postgresql uses the keyword DEFAULT with no ticks to get a default.

> insert into table bubba values ('truck','washer',DEFAULT,'gun
> rack',DEFAULT,36,24,36);

That's new in 7.3, though. In prior releases you could only (a) omit
columns at the right, or (b) use a column name list.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rajesh Kumar Mallah. 2002-11-12 18:48:18 Re: [SQL] Output of function into a file
Previous Message Vassil Kriakov 2002-11-12 17:27:34 Re: C++: get value for integral types?