Re: No serial type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: "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 18:37:53
Message-ID: 22596.1227033473@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-11-18 18:41:49 Re: Slow queries when ORDER BY ... DESC with table inheritance (no index scan backwards)
Previous Message Phoenix Kiula 2008-11-18 18:18:36 Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?