Skip site navigation (1) Skip section navigation (2)

Default sequence values

From: "Seth Banks" <seth(at)subimage(dot)com>
To: <pgsql-sql(at)postgreSQL(dot)org>
Subject: Default sequence values
Date: 2000-02-27 07:45:36
Message-ID: NOEPJACOBMIOEOLHKIODIEFLCBAA.seth@subimage.com (view raw or flat)
Thread:
Lists: pgsql-sql
I'm getting errors in pgsql when I try to run this create table statement
past...Could someone help me out here? I think it's the default value of
company_id that's erroring out. Any help is appreciated.

CREATE SEQUENCE company_id_seq;
CREATE TABLE company (
  company_id     int4 PRIMARY KEY DEFAULT nextval(company_id_seq),
  parent_id      int4 NULL,
  name           text NOT NULL,
  address_1      text NULL,
  address_2      text NULL,
  fax            text NULL,
  city           text NULL,
  state_province text NULL,
  zip            text NULL,
  country        text NULL,
  description    text NULL,
  stock_symbol   text NULL
);
CREATE INDEX name_idx on company (name);


Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2000-02-27 07:48:20
Subject: Re: [SQL] Default sequence values
Previous:From: mpg4Date: 2000-02-27 02:29:51
Subject: Nested BEGIN...COMMIT transactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group