"SELECT * FROM Guests"
terminate called after throwing an instance of 'pqxx::undefined_table' what(): ERROR: relation "guests" does not exist
but the table exists! The solution is to put table name in double
quotation marks. Single quotation marks will not work. This should work
"SELECT * FROM \"Guest\""
Same goes for column names:
"SELECT Name FROM \"Guest\""
terminate called after throwing an instance of 'pqxx::undefined_column' what(): ERROR: column "name" does not exist
This corrected version, however, does not throw any error:
"SELECT \"Name\" FROM \"Guest\""
I'm not sure why. The PostgreSQL documentation doesn't mention this and there are numerous examples on the Internet that claim to work and have no quotation marks in front and after each column name and table name.