I have 2 tables in postgres, product and product2
I cannot query product2
query 2 works well,
query 1 and 3 does not run and gives error "relation does not exist"

please help.
I found out that when you query SELECT * FROM public.PRODUCT2, you are actually querying product2 table (with lowercase).
It is like all of the text of your query are converted to lowercase characters before actually run.
The text between double quotes does not converted to lowercase so the below query worked.
SELECT * FROM public."PRODUCT2"
SELECT * FROM public."PRODUCT2".PRODUCT2andproduct. Since tablePRODUCT2contains upper case letters it must have been created with double quotes ("...") therefore you must always use double quotes when referencing it. The tableproductdoes not have any such restriction; it was created without double quotes. Double quotes makes the name case sensitive. SoPRODUCTandproductrefer to the same table, butPRODUCT2and"PRODUCT2"are different tables.UPDATE MY_TABLE SET A = 5;can equivalently be written as:uPDaTE my_TabLE SeT a = 5;(...) There is a second kind of identifier: the delimited identifier or quoted identifier. It is formed by enclosing an arbitrary sequence of characters in double-quotes (").(...) Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case. As above: usepublic."PRODUCT2"