From: Tom Lane <tgl@sss.pgh.pa.us>
To: Erik Aronesty <erik@q32.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: alter table serial->int
Date: Sun, 11 Nov 2007 10:37:11 -0500
Message-ID: <18969.1194795431@sss.pgh.pa.us> (raw)
In-Reply-To: <ccd588d90711110415n40a61249pbcb67cf5d4c73f0d@mail.gmail.com>
References: <ccd588d90711061359m57d95921mc28b74dec9f35f54@mail.gmail.com>
<7625.1194412270@sss.pgh.pa.us>
<ccd588d90711080813j45a1cbd4u2f789e25fcc16162@mail.gmail.com>
<ccd588d90711080817j482f1d39n80dee4334383ab51@mail.gmail.com>
<20071108195721.GU2938@alvh.no-ip.org>
<ccd588d90711110415n40a61249pbcb67cf5d4c73f0d@mail.gmail.com>
"Erik Aronesty" <erik@q32.com> writes:
> alter table x alter a set default 999;
> still doesn't help.
Doesn't help what?
If you mean that the sequence object is still there, you can drop that too.
regression=# create table x(a serial not null);
NOTICE: CREATE TABLE will create implicit sequence "x_a_seq" for serial column "x.a"
CREATE TABLE
regression=# drop sequence x_a_seq;
NOTICE: default for table x column a depends on sequence x_a_seq
ERROR: cannot drop sequence x_a_seq because other objects depend on it
HINT: Use DROP ... CASCADE to drop the dependent objects too.
regression=# alter table x alter a set default 999;
ALTER TABLE
regression=# drop sequence x_a_seq;
DROP SEQUENCE
regression=# \d x
Table "public.x"
Column | Type | Modifiers
--------+---------+----------------------
a | integer | not null default 999
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, erik@q32.com
Subject: Re: alter table serial->int
In-Reply-To: <18969.1194795431@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox