Trying to create tables without double quoting the name is resulting in a syntax error, only quoting it works:
# CREATE TABLE user (
email TEXT,
first_name TEXT,
last_name TEXT,
password TEXT,
plan TEXT,
gender gender
);
ERROR: syntax error at or near "user"
LINE 1: CREATE TABLE user (
^
# CREATE TABLE "user" (
email TEXT,
first_name TEXT,
last_name TEXT,
password TEXT,
plan TEXT,
gender gender
);
CREATE TABLE
# \dt
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | user | table | postgres
(1 row)
This is on PosgreSQL 9.5.5 shipping with Ubuntu 16.10:
PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005, 64-bit
I know it's a bad idea to quote names in PostgreSQL but I can't get around this, what's wrong?