Re: auto-increment field : in a simple way

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Vineet Deodhar <vineet(dot)deodhar(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: auto-increment field : in a simple way
Date: 2012-10-11 09:35:14
Message-ID: 507692D2.9060101@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/11/2012 05:11 PM, Vineet Deodhar wrote:
> On Thu, Oct 11, 2012 at 12:56 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com
> <mailto:scott(dot)marlowe(at)gmail(dot)com>> wrote:
>
>
> Can't you just add this to your create table:
>
>
> CREATE TABLE tablename (
> colname SERIAL
> , check (colname>0 and colname < 32768));
> );
>
>
>
> With this constraint, whether the storage space requirement would reduce?
> OR
> Is it just for validation of data?

It's purely validation and has no effect on storage size.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vineet Deodhar 2012-10-11 09:39:09 Re: moving from MySQL to pgsql
Previous Message Craig Ringer 2012-10-11 09:34:34 Re: moving from MySQL to pgsql