Re: Question about NOT NULL and default values.

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Tim Uckun" <timuckun(at)gmail(dot)com>
Cc: Chris <dmagick(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question about NOT NULL and default values.
Date: 2008-10-17 03:36:15
Message-ID: dcc563d10810162036j326a1f00g971d70a6d5ca07a1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 16, 2008 at 9:26 PM, Tim Uckun <timuckun(at)gmail(dot)com> wrote:
>> Not sure how you do this in rails but if you use DEFAULT in the query it
>> works:
>>
>>> create table a(a int default 5);
>> CREATE TABLE
>>
>>> insert into a(a) values (DEFAULT);
>> INSERT 0 1
>
> Unfortunately the SQL is being generated by the ORM. I really don't
> want to bypass the ORM that would be way too painful.

Are you using the ruby-pg interface? I was under the impression it
handled this properly.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-17 03:37:25 Re: Question about fulltext search and to_tsvector function
Previous Message Mike Christensen 2008-10-17 03:31:10 Question about fulltext search and to_tsvector function