Re: What's wrong with this SQL?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Adam <adam(at)spatialsystems(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: What's wrong with this SQL?
Date: 2006-05-10 04:29:07
Message-ID: BD7F042D-13E8-4ABA-AD08-9F96D117A341@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On May 10, 2006, at 12:06 AM, Adam wrote:

> CREATE TABLE "users" ("user_ID" SERIAL(12), "first_name" character
> varying(40) NOT NULL, "last_name" character varying(40) NOT NULL,
> "password" character varying(16) NOT NULL, "email" character varying
> (100) NOT NULL, "privilege" integer(2) NOT NULL, PRIMARY KEY
> ("user_ID"))

PostgreSQL integers don't have a size property. So SERIAL(12) and
integer(2) are wrong. See the type choices here:

http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-
INT

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-05-10 04:37:19 Re: Preventing SQL Injection in PL/pgSQL in psql
Previous Message Chris 2006-05-10 04:20:12 Re: What's wrong with this SQL?