Re: Postgres SQL Syntax - Mailing list pgsql-general

From Tom Lane
Subject Re: Postgres SQL Syntax
Date
Msg-id 13761.1170382834@sss.pgh.pa.us
Whole thread Raw
In response to Postgres SQL Syntax  ("Jim C." <jlistnews@gmail.com>)
List pgsql-general
"Jim C." <jlistnews@gmail.com> writes:
> I've a postgres statement that reads:
> CREATE TABLE "channel" (
>     "chanid" int NOT NULL default '0',
>       "channum" varchar(10) NOT NULL default '',
>     "freqid" varchar(10) default NULL,
>     "sourceid" int default NULL,
> .
> .
> .
>     PRIMARY KEY  ("chanid"),
>     KEY "channel_src" ("channum","sourceid")
> );

That's not Postgres, and it's not SQL either ... it's a MySQL-ism.
Use a separate CREATE INDEX statement.

> Where can I find good examples of postgres syntax?

In the manual?
http://www.postgresql.org/docs/8.2/interactive/index.html
(adjust URL to match your PG version)

            regards, tom lane

pgsql-general by date:

Previous
From: "Jim C."
Date:
Subject: Postgres SQL Syntax
Next
From: "Merlin Moncure"
Date:
Subject: Re: How to allow users to log on only from my application not from pgadmin