Re: No serial type

From: Erik Jones <ejones(at)engineyard(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>, "Simon Connah" <simon(dot)n(dot)connah(at)btopenworld(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: No serial type
Date: 2008-11-18 23:38:34
Message-ID: E7909354-2428-48D6-822E-E4F261BDDDB8@engineyard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Nov 18, 2008, at 10:37 AM, Tom Lane wrote:

> "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> writes:
>> On Tue, Nov 18, 2008 at 10:24 AM, Simon Connah
>> <simon(dot)n(dot)connah(at)btopenworld(dot)com> wrote:
>>> But whenever I try and update my column to this type it says that
>>> it can not
>>> find that data type. Am I doing something wrong?
>
>> Serial is a "pseudotype".
>
> Perhaps better to say it's a macro, which is currently recognized by
> column creation but not ALTER COLUMN TYPE. In recent versions you
> could
> do "ALTER TABLE ADD COLUMN foo serial", if that helps.
>
> I'm not sure if it'd be sensible to allow "ALTER COLUMN TYPE serial";
> it seems like that might do more than you were expecting. ALTER TYPE
> is a pretty low-level operation, imo.

I agree, there would also be the question of the sequence's starting
value. Some people would "expect" it to find the max value already in
the column and automatically set it's start value based on that which
may in turn surprise others.

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-11-19 00:02:33 Re: How to reduce impact of a query.
Previous Message Christian Schröder 2008-11-18 23:16:19 Re: No serial type