Error: Column does not exist

When it comes to Postgresql and entity names (Tables, Columns, etc.) with UPPER CASE letters, you need to “escape” the word by placing it in “”. Please refer to the documentation on this particular subject. So, your example would be written like this: String stm = “DELETE FROM hostdetails WHERE \”MAC\” = ‘kzhdf'”; On a … Read more

Strange behaviour in Postgresql

Your update_tbl_point function is probably doing something like this: new.last_update = current_timestamp; but it should be using new.”Last_Update” so fix your trigger function. Column names are normalized to lower case in PostgreSQL (the opposite of what the SQL standard says mind you) but identifiers that are double quoted maintain their case: Quoting an identifier also … Read more

When do Postgres column or table names need quotes and when don’t they?

PostgreSQL converts all names (table name, column names etc) into lowercase if you don’t prevent it by double quoting them in create table “My_Table_ABC” ( “My_Very_Upper_and_Lowercasy_Column” numeric,…). If you have names like this, you must always double quote those names in selects and other references. I would recommend not creating tables like this and also … Read more

sql statement error: “column .. does not exist”

No, the column FK_Numbers_id does not exist, only a column “FK_Numbers_id” exists Apparently you created the table using double quotes and therefor all column names are now case-sensitive and you have to use double quotes all the time: select sim.id as idsim, num.id as idnum from main_sim sim left join main_number num on (“FK_Numbers_id” = … Read more

Cannot simply use PostgreSQL table name (“relation does not exist”)

From what I’ve read, this error means that you’re not referencing the table name correctly. One common reason is that the table is defined with a mixed-case spelling, and you’re trying to query it with all lower-case. In other words, the following fails: CREATE TABLE “SF_Bands” ( … ); SELECT * FROM sf_bands; — ERROR! … Read more