[postmodern-devel] using dao-class on database with column names like "addr:city"

Zach Beane xach at xach.com
Tue Jun 14 12:48:02 UTC 2011


John Morrison <john.nmi.morrison at gmail.com> writes:

> On Tuesday 14 June 2011, Marijn Haverbeke wrote:
>> If colons are safe in SQL field names, you can change
>> s-sql::to-sql-name to leave them intact (there seems to already by an
>> exception for * characters).
>
> Thanks, and will do...
>
> As regards colons in column names: while I am by no means an
> experienced SQL guy, AFAICT the various GIS tools I am using all seem
> (so far) to be functioning correctly on databases with those column
> names.

For what it's worth, a column (or other object) may use any kind of
string as its name if enclosed in double-quotes. They're a bit like CL
symbols and ||s in that regard.

    db=> create table foo ("I am a Column" int);
    CREATE TABLE

    db=> insert into foo values (1);
    INSERT 0 1

    db=> select * from foo;
     I am a Column 
    ---------------
                 1
    (1 row)

Zach




More information about the postmodern-devel mailing list