Scott Marlowe schrieb:
On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma
wrote:
On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
wrote:
Why does this not work:
postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
ERROR: type "serial" does not exist
serial is really just "short-hand" fo
Richard Broersma schrieb:
On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
wrote:
Why does this not work:
postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
ERROR: type "serial" does not exist
serial is really just "short-hand" for making an integer column use
default incrementing fun
Jasen Betts schrieb:
On 2009-01-31, Andreas Wenk wrote:
Hi List,
I have a short question to psql.
Why does this not work:
postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
ERROR: type "serial" does not exist
but this:
postgres=# ALTER TABLE tab1 DROP COLUMN nr;
ALTER TABLE
postgres
2009/2/1 Scott Marlowe :
> On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma
> wrote:
>> On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
>> wrote:
>>
>>> Why does this not work:
>>>
>>> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
>>> ERROR: type "serial" does not exist
>>
>> serial is
all you have to really do is:
create sequence foo_bar_new_column_tralala_seq;
ALTER TABLE foo_bar ADD COLUMN tralala int NOT NULL DEFAULT
nextval('foo_bar_new_column_tralala_seq');
That's all there's to it
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to
On Sat, Jan 31, 2009 at 9:04 PM, Richard Broersma
wrote:
> On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
> wrote:
>
>> Why does this not work:
>>
>> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
>> ERROR: type "serial" does not exist
>
> serial is really just "short-hand" for making a
On Sat, Jan 31, 2009 at 3:16 PM, Andreas Wenk
wrote:
> Why does this not work:
>
> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
> ERROR: type "serial" does not exist
serial is really just "short-hand" for making an integer column use
default incrementing function. The following wil
On 2009-01-31, Andreas Wenk wrote:
> Hi List,
>
> I have a short question to psql.
>
> Why does this not work:
>
> postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
> ERROR: type "serial" does not exist
>
> but this:
>
> postgres=# ALTER TABLE tab1 DROP COLUMN nr;
> ALTER TABLE
> postgres=
Hi List,
I have a short question to psql.
Why does this not work:
postgres=# ALTER TABLE tab1 ALTER COLUMN nr TYPE serial;
ERROR: type "serial" does not exist
but this:
postgres=# ALTER TABLE tab1 DROP COLUMN nr;
ALTER TABLE
postgres=# ALTER TABLE tab1 ADD COLUMN nr serial;
NOTICE: ALTER TA