Re: postgresql "TABLENAME" versus TABLENAME

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jul 06 2004 - 11:06:57 EDT

  • Next message: Ashley Aitken: "Client-Side DataContext?"

    Hi Tore,

    So are you saying that a doublequote is actually a part of the table
    name? That's weird, but still I think we should support this in
    Cayenne. Could you open a bug report please, showing where exactly this
    breaks. I'll make sure that when the XML is stored the name is properly
    escaped.

    Andrus

    On Jul 1, 2004, at 3:32 PM, Tore Halset wrote:

    > Hello.
    >
    > I have a database created by a import/export tool called ogr2ogr. It
    > creates tables and columns with captial letters as shown in the
    > example below. I am having trouble mapping this in cayenne. Using "s
    > in the Modeler makes the mapping xml file unparsable.
    >
    > Perhaps cayenne should use "s around every table name and field name
    > for every query? Perhaps only for postgresql databases? This would
    > make "TABLENAME" work, but will potensially break lots of old mapping
    > files. Perhaps this can be solved by configuring the database or the
    > jdbc driver?
    >
    > toretest=> create table "TABLENAME" ("FIELD" int);
    > CREATE TABLE
    > toretest=> \d "TABLENAME"
    > Table "public.TABLENAME"
    > Column | Type | Modifiers
    > --------+---------+-----------
    > FIELD | integer |
    >
    > toretest=> select * from TABLENAME;
    > ERROR: relation "tablename" does not exist
    > toretest=> select FIELD from "TABLENAME";
    > ERROR: column "field" does not exist
    > toretest=> select "FIELD" from "TABLENAME";
    > FIELD
    > -------
    > (0 rows)
    >
    > Regards,
    > - Tore.
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Jul 06 2004 - 11:07:01 EDT