No serial type - Mailing list pgsql-general

From Simon Connah
Subject No serial type
Date
Msg-id 20F76673-4FB5-4841-BE8E-5FF190E27DDC@btopenworld.com
Whole thread Raw
Responses Re: No serial type  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general
Hi,
I've just started using PostgreSQL and have been reading up on it.
Part of what I wanted to do was to have a column which automatically
incremented itself by one every time I do an INSERT. From reading the
manual I was lead to believe that the correct type for this was either
serial or bigserial. 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?

This is what I get:

simon=> ALTER TABLE users ALTER COLUMN userid TYPE serial;
ERROR:  type "serial" does not exist

I'm running this version:

simon=> SELECT version();
                                          version
-----------------------------------------------------------------------------------------
  PostgreSQL 8.3.3 on i386-unknown-openbsd4.4, compiled by GCC cc
(GCC) 3.3.5 (propolice)
(1 row)

Thank you or any help.

"I disapprove of what you say, but I'll defend to the death your right
to say it." - Voltaire





pgsql-general by date:

Previous
From: Shane Ambler
Date:
Subject: Re: Foreign Key 'walker'?
Next
From: Magnus Hagander
Date:
Subject: Re: High Availability for PostgreSQL on Windows 2003.