Re: A couple of newbie questions ...

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: rod(at)iol(dot)ie
Cc: admin <mick(at)mjhall(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: A couple of newbie questions ...
Date: 2008-07-23 10:07:56
Message-ID: 488702FC.2020403@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 23/07/2008 11:01, Raymond O'Donnell wrote:
> On 23/07/2008 10:48, admin wrote:
>> 1. Is a SEQUENCE what I use instead of auto_increment?
>
> Yes. The easiest thing is to define the column as type SERIAL - this
> will create the sequence for you and associate it with the column.
> Alternatively, you can create the sequence by hand, create the column as
> an integer type, and then set the default for the column as

I forgot to mention that you'll need to grant SELECT and UPDATE
permissions on the sequence to the user that'll be accessing the table -
this still catches me betimes. :-)

Ray.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-07-23 10:10:28 Re: A couple of newbie questions ...
Previous Message Raymond O'Donnell 2008-07-23 10:01:13 Re: A couple of newbie questions ...