3 ms·
Of those, user is the only one that must be quoted in postgresql. It doesn't show up that way in psql through, so it's a bit inconsistent. test=# create tab
by wiredfool 3y ago
Of those, user is the only one that must be quoted in postgresql. It doesn't show up that way in psql through, so it's a bit inconsistent.
test=# create table test (
id serial,
"user" text,
date text,
timestamp text,
name text,
version text);
CREATE TABLE
Then again, lots of things are actually valid column identifiers, if they're quoted.
test=# alter table test add column "select" text;
ALTER TABLE
test=# alter table test add column "*" text;
ALTER TABLE
test=# alter table test add column "from" text;
ALTER TABLE
test=# select "select", "*", "from" from test;
select | * | from
--------+---+------
(0 rows)
test=# \d test
Table "public.test"
Column | Type | Collation | Nullable | Default
-----------+---------+-----------+----------+----------------------------------
id | integer | | not null | nextval('test_id_seq'::regclass)
user | text | | |
date | text | | |
timestamp | text | | |
name | text | | |
version | text | | |
select | text | | |
* | text | | |
from | text | | |