Cannot select columns by their names in PostgreSQL

413 views Asked by At

I downloaded a PostreSQL file that creates and populates the Chinoook database (a relatively well known database used for testing).

I then opened the file on sqliteonline (an online compiler where you can test SQL code).

Opening the SQL file created and populated all tables as expected. However, the following query throws an error:

SELECT ArtistId
FROM "Artist";

db error: ERROR: column "artistid" does not exist

Which is odd, because the column does exist in that table:

select *
from "Artist";
ArtistId Name
1 AC/DC
2 Accept
3 Aerosmith
4 Alanis Morissette
5 Alice in Chains

How come I cannot select any columns by their names?

0

There are 0 answers