No serial type

From: Simon Connah <simon(dot)n(dot)connah(at)btopenworld(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: No serial type
Date: 2008-11-18 17:24:14
Message-ID: 20F76673-4FB5-4841-BE8E-5FF190E27DDC@btopenworld.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2008-11-18 17:31:37 Re: High Availability for PostgreSQL on Windows 2003.
Previous Message Shane Ambler 2008-11-18 17:20:19 Re: Foreign Key 'walker'?