error creating table for postgres

Igor de Oliveira Couto igor at semperuna.com
Mon Apr 22 00:18:27 EDT 2013


On 22/04/2013, at 10:54 AM, Dr. Hawkins <dochawk at gmail.com> wrote:

> I think the following had been working for some time, but now it creates an
> error:
> 
> CREATE TABLE plumber_joe_the__001_sofa  (uniq_sfky INTEGER PRIMARY KEY ,
> subq CHAR(3) , a TEXT, b TEXT, c TEXT, d TEXT, ordr INTEGER, user CHAR(20),
> tstmp TIMESTAMP WITH TIMEZONE )
> produces
> 
> Error:  syntax error at or near "user" at character 135

AFAIK, "USER" is a reserved word in SQL - since SQL-92:

http://developer.mimer.com/validator/sql-reserved-words.tml

There are some online SQL validators which you may find useful, if you run into issues like this. The site above has 3 validators, which validate your syntax against the SQL standard, rather than trying to validate it against syntax specific to a certain product - ie., MySQL, PostgreSQL, or SQLite. The address for the validators are:

SQL-92:
http://developer.mimer.com/validator/parser92/index.tml

SQL-99:
http://developer.mimer.com/validator/parser99/index.tml

SQL-2003:
http://developer.mimer.com/validator/parser200x/index.tml

I hope this helps!

--
Igor Couto
Sydney, Australia








More information about the use-livecode mailing list