Re: Create table syntax

From: Arne Weiner <aswr(at)gmx(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create table syntax
Date: 2001-08-30 17:39:54
Message-ID: 3B8E7A6A.4763DF1E@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

satish rao wrote:
>
> Hi
>
> Entered below is the SQL create table syntax:
>
> CREATE TABLE lists (
> [listid] [int] IDENTITY (1, 1) NOT NULL ,
> [listname] [varchar] (200) NULL ,
> [listcreator] [varchar] (200) NULL ,
> [listdesc] [text] NULL)
>
> We need to know that this syntax will work properly in=20
> postgresql while creating the table and the=20
> autoincrement option for the column(listid). If this=20
> syntax is not correct for postgresql, we need the=20
> correct syntax.
>

CREATE TABLE lists (
listid SERIAL NOT NULL ,
listname varchar(200) NULL ,
listcreator varchar(200) NULL ,
listdesc text NULL);

This create statement is accepted from postgres. The type SERIAL does
the
autoincremention. This Statement should do what you want.

Arne.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-08-30 17:42:59 Re: Create table syntax
Previous Message Oleg Lebedev 2001-08-30 17:16:11 Re: [SQL] HELP: Trend reporting