3 ms·
There's many keywords that make good column names though - user, id, name, date, version, timestamp.
by jstx1 3y ago
There's many keywords that make good column names though - user, id, name, date, version, timestamp.
- wiredfool 3y agoOf 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 | | |