Re: auto-increment field : in a simple way - Mailing list pgsql-general

From Craig Ringer
Subject Re: auto-increment field : in a simple way
Date
Msg-id 507692D2.9060101@ringerc.id.au
Whole thread Raw
In response to Re: auto-increment field : in a simple way  (Vineet Deodhar <vineet.deodhar@gmail.com>)
List pgsql-general
On 10/11/2012 05:11 PM, Vineet Deodhar wrote:
> On Thu, Oct 11, 2012 at 12:56 PM, Scott Marlowe <scott.marlowe@gmail.com
> <mailto:scott.marlowe@gmail.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



pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: moving from MySQL to pgsql
Next
From: Vineet Deodhar
Date:
Subject: Re: moving from MySQL to pgsql