Autonumbering column
Started by Ryan Mchaleover 27 years ago3 messagesgeneral
Re: [GENERAL] Autonumbering column
Hi,
Is there anyway to have an autonumbering field?
I don't think so, but there is a way to generate the values for a key
column safely. Look at the manpage on create_sequence...james
Re: [GENERAL] Autonumbering column
this is a hack, but it works...
CREATE SEQUENCE key_s INCREMENT 1 START 1;
CREATE TABLE cliente (
key int4 NOT NULL DEFAULT nextval('key_s') PRIMARY KEY,
name varchar(100) UNIQUE NOT NULL,
username varchar(8) NOT NULL
);
Hi,
Is there anyway to have an autonumbering field?
I don't think so, but there is a way to generate the values for a key
column safely. Look at the manpage on create_sequence...james
Antonio Garcia Mari
Mallorca (Spain)