News for hackers. Stuff that matters.
Re:Show HN: Prisma Postgres. Runs on bare metal and unikernels by yen223 on Saturday November 02, 2024 @11:38PM (#42031008)
Postgres has very counterintuitive behaviour around case-sensitivity.

  CREATE TABLE CamelCase(...)
  SELECT * FROM "CamelCase";
will fail with "CamelCase" not being a table.

That's because the CREATE TABLE statement creates a table named "camelcase", not "CamelCase", despite what you might assume from the query.

Re:Show HN: Prisma Postgres. Runs on bare metal and unikernels by hu3 on Sunday November 03, 2024 @01:26AM (#42031320)
Daily WTF.

No bit seriously, thanks for sharing. I'll always do lower case table names from now on.

Re:Show HN: Prisma Postgres. Runs on bare metal and unikernels by DrBenCarson on Sunday November 03, 2024 @08:51AM (#42033040)
It’s not lower case, you should be using snake_case
Re:Show HN: Prisma Postgres. Runs on bare metal and unikernels by hu3 on Sunday November 03, 2024 @10:40AM (#42033662)
yeah. both
Re:Show HN: Prisma Postgres. Runs on bare metal and unikernels by sixbrx on Sunday November 03, 2024 @05:27PM (#42036594)
Thats not particular to postgres, that's the same in Oracle (or any other db following ISO case handling I believe), just with true (quoted) table name being all uppercase instead for the latter but with same error.

You can quote the table name in the create statement to get the camelcase table name. Just remember to quote in both creation and usage or neither, is a good rule of thumb