Re: A couple of newbie questions ...

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: A couple of newbie questions ...
Date: 2008-07-23 16:00:12
Message-ID: 4887558C.8060405@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer wrote:

> INSERT INTO table (fld_y,fld_z) VALUES ('y','z')
>
> which is really doing:
>
> INSERT INTO table (fld_x, fld_y,fld_z) VALUES (DEFAULT, 'y','z')
>

To be honest I hadn't seen the use of INSERT INTO table (fld_x,
fld_y,fld_z) VALUES (DEFAULT, 'y','z') before, I have always gone with
INSERT INTO table (fld_x, fld_y,fld_z) VALUES (NULL, 'y','z')

is DEFAULT a better option than using NULL? or is it just a preference
to spell out the implied default entry?

I've only used DEFAULT in CREATE TABLE(...)

--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sushant Sinha 2008-07-23 16:17:26 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Shane Ambler 2008-07-23 15:56:29 Re: A couple of newbie questions ...