0

I am trying to create tables and columns with pgAdmin4 with query editor.

Each time I try

CREATE TABLE Tags 
(
    ID SERIAL PRIMARY KEY,
    description TEXT NOT NULL
);

for example. The table created is with lower case 't' for tags and lowercase id

enter image description here

Any help?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nohra Seif
  • 21
  • 3
  • 2
    SQL DML and DDL is not case-sensitive. There's no difference between ID, id, Id or iD. There's also no difference between SELECT, select, SeLecT or sELECt. The only time case should matter is when presenting it to the user of your app, and you can handle that in your SELECT output by aliasing the column with `AS`. – Ken White Mar 28 '22 at 22:53
  • Ken is correct, but I will add I never code sql using any caps. At all. [There is no good reason to code SQL in uppercase](https://stackoverflow.com/questions/292026/is-there-a-good-reason-to-use-upper-case-for-sql-keywords/11945218#11945218). There is scientific proof that [it's a myth the uppercase is easier to read](https://www.blog.theteamw.com/2009/12/23/100-things-you-should-know-about-people-19-its-a-myth-that-all-capital-letters-are-inherently-harder-to-read). Embrace the 21st century and code using *all* the letters! – Bohemian Mar 28 '22 at 23:31
  • Thank you both for your answers :) – Nohra Seif Mar 30 '22 at 15:02

1 Answers1

0

You need to put your name of the table into quotation marks ""

CREATE TABLE "Tags" 
(
    "ID" SERIAL PRIMARY KEY,
    description TEXT NOT NULL
);
Priyansh
  • 1,163
  • 11
  • 28
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 31 '23 at 03:35