Re: [BUGS] Creating a table by loading a sql file. - Mailing list pgsql-bugs

From Oleksandr Shulgin
Subject Re: [BUGS] Creating a table by loading a sql file.
Date
Msg-id CACACo5TN_0b-cFXDiiYO_Y4OFn7gono7tvE0_Mn4TA+SQq7P7g@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] Creating a table by loading a sql file.  (Devrim Gündüz <devrim@gunduz.org>)
List pgsql-bugs
On Fri, Oct 27, 2017 at 10:18 AM, Devrim Gündüz <devrim@gunduz.org> wrote:

Hi,

On Fri, 2017-10-27 at 04:55 +0000, rhodesm4 wrote:
> psql:users.sql:10: ERROR:  syntax error at or near "USER"
> LINE 1: CREATE TABLE USER(

USER is a reserved keyword in PostgreSQL:

https://www.postgresql.org/docs/current/static/sql-keywords-appendix.html

You need to change the table name.

Or put double-quotes around the name: CREATE TABLE "USER"...

--
Alex

pgsql-bugs by date:

Previous
From: sathishr@eazyerp.com
Date:
Subject: [BUGS] BUG #14884: Encoding Error
Next
From: k.daskalov.911@gmail.com
Date:
Subject: [BUGS] BUG #14885: mistake in sorting win1251 chars