Sample Header Ad - 728x90

Can column name be "Group" in PostgreSQL or in any databases

9 votes
2 answers
28737 views
I was designing a project which specifies that in a table what column name should be and one of the column name in the specification is "group". I tried creating it but it always throw a syntax error near the word = "group". I am really curious since the keyword in SQL is "group by" not group, so what is the reason, I cannot rename or create a column with a name "group". Syntax and error I am using and getting:
ALTER TABLE test RENAME COLUMN sum TO group;
ERROR:  syntax error at or near "group"
LINE 1: ALTER TABLE test RENAME COLUMN sum TO group;
Asked by AKIWEB (625 rep)
Oct 26, 2013, 07:16 PM
Last activity: Dec 12, 2021, 01:38 PM