Re: PostgreSQL primary (sequence) key issue (Ruby/Rails)

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: <pgsql-general(at)postgresql(dot)org>, Andrew Madu <andrewmadu(at)gmail(dot)com>
Subject: Re: PostgreSQL primary (sequence) key issue (Ruby/Rails)
Date: 2007-03-02 16:12:09
Message-ID: C20D9AE9.6CBD2%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> The portable (and correct) way to do it is to use the DEFAULT keyword
> like this:
>
> INSERT INTO some_table (id_field) VALUES (DEFAULT);

Alternatively, for columns for which you have no value, don't specify them
at all in the insert.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2007-03-02 16:26:03 Re: psql client quits after 1st command
Previous Message Douglas McNaught 2007-03-02 16:07:37 Re: psql client quits after 1st command