#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    1
    Rep Power
    0

    Exclamation PostgreSQL and double quotes (")


    Hi..

    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.
  2. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    See http://www.postgresql.org/idocs/inde...AX-IDENTIFIERS

    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.
    The real n-tier system:

    FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

    Amazon wishlist -- rycamor (at) gmail.com

IMN logo majestic logo threadwatch logo seochat tools logo