August 1st, 2002, 08:29 AM
PostgreSQL and double quotes (")
I'm trying to port an Access database application (written in ASP) to PostgreSQL. My problem is this: Every SQL statement I make HAS TO have double quotes around tablenames og columnnames. If not... then either "ERROR: Relation "tbl_name does not exist" or ERROR: "Attribute 'columnname' not found" is thrown. The PostgreSQL user manual states that both statement types are valid. Now, if I have to include double quotes around every table/column name then I have to rewrite every single SQL statement in the whole application (there are a lot!). I'm trying to convince my collegues that PostgreSQL is the cheapest and most efficient way to sell our product.... cheaper than SQL Server. So a suggestion how to fix this would be nice. Maybe it's a flag in postmaster or something??? I'm using ODBC to connect to the database. Thanks.
August 2nd, 2002, 09:19 PM
The problem in your case is that you used quotes when creating the tablenames, so you are stuck with using quotes to query the tables. If you re-do your SQL creation statements to NOT use quotes, then all tablenames and column names are wrapped to lower-case, and you will have no problem.
Note: if you used some sort of third-party tool, such as phpPgAdmin, or PgAdmin, etc... to create your tables, the quotes were probably automatic. Try just manually editing your table creation statements, saving to a text file, and then piping that text file to the psql terminal.