Re: No serial type - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: No serial type
Date
Msg-id 4922FE2B.9070603@iol.ie
Whole thread Raw
In response to Re: No serial type  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Responses Re: No serial type
List pgsql-general
On 18/11/2008 17:37, Scott Marlowe wrote:

> create table a (i int primary key, info text);
> create sequence a_i_seq;
> alter table a alter column i set default nextval('a_i_seq');

You'll also need to grant SELECT and UPDATE permissions on the sequence
to the user that'll be INSERTing into the table.....this catches me
regularly. :-)

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Conversion of string to int using digits at beginning
Next
From: "DANG Trieu"
Date:
Subject: Re: Slow queries when ORDER BY ... DESC with table inheritance (no index scan backwards)