Search Postgresql Archives

Re: ALTER Bigserial error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Little, Douglas" <DOUGLAS.LITTLE@xxxxxxxxxx> writes:
> I'm trying to alter in a bigserial on GP/PG 8.1  I'm getting the error

> ERROR: type "bigserial" does not exist
> SQL state: 42704

> I understand that bigserial isn't a 'true' type, that it's a notational convenience.
> And that I can alter in the default.

> But it is listed in the type table in the doc and I can create new tables with it.
> I should be able to use it in an alter.
> Is there a way to fix this bug?

It isn't a bug; it could be argued to be a missing feature, but I don't
think it's very high on anyone's priority list to add.  Before anything
could happen here there would need to be consensus on how to behave in
all the various corner cases.  For instance, should the ALTER override
any pre-existing default expression for the column?  If there's not
already a sequence associated with the column, what initial value should
it be created with?  Should the ALTER make any attempt to check or
correct the data in the column?

The only case that seems to me to not have some debatable behavior
involved is widening an existing serial column --- and you can do that
now with "ALTER TYPE bigint".  Since serial/bigserial are just macros
for column properties that you can set explicitly, it's always possible
to get where you want to go with lower-level operations; and those
operations give you full control over what happens, whereas a
packaged-up "ALTER TYPE bigserial" operation wouldn't.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux