Обсуждение: Cold Fusion to pgSQL

Поиск
Список
Период
Сортировка

Cold Fusion to pgSQL

От
Daniel Clark
Дата:
Hi all,

A very newbie question...

Just started using ColdFusion5.0(Linux) against pgSQL(Linux7.1) using ODBC

It seems that ColdFusion sends along LowerCase TableNames and ColumnNames to pgSQL even if I program the .cfm files
withMixedCase strings 

The result is failure to locate tables and columns until I rename them in all lowercase.

Is there some feature in pgSQL that can make it insensitive to case in tablenames and column names?

Thanks,
Daniel



Re: Cold Fusion to pgSQL

От
"Ross J. Reedstrom"
Дата:
On Fri, Jul 06, 2001 at 12:49:16PM -0700, Daniel Clark wrote:
> Hi all,
>
> A very newbie question...
>
> Just started using ColdFusion5.0(Linux) against pgSQL(Linux7.1) using ODBC
>
> It seems that ColdFusion sends along LowerCase TableNames and ColumnNames to pgSQL even if I program the .cfm files
withMixedCase strings 
>
> The result is failure to locate tables and columns until I rename them in all lowercase.
>
> Is there some feature in pgSQL that can make it insensitive to case in tablenames and column names?
>

This is a required feature of ANSI SQL: case insensitivity. PostgreSQL
implements this by downcasing all identifiers (Oracle, and MS-SQL,
UPCASE EVERYTHING), unless they're quoted. I'm guessing your using some
tool to create your MixedCase tablenames, and it's quoting them for you
behind your back.

So, either lose the quotes on the identifiers when you create the schema
(i.e., let them get down cased) or write all your CF like so:

select "SomeColumn"."SomeTable", "SomeOtherColumn"."SomeOtherTable" from
"SomeTable","SomeOtherTable" ...

Ross

P.S. Yup, you have to quote each identifier seperately, not the dotted
identifier. Because, according to the standard, once you quote it,
anything goes, so "This.is my Really Weird_column.name" is completely
valid.

Re: Cold Fusion to pgSQL

От
Daniel Clark
Дата:
Hummm ... Thanks Ross.

Thinking about this then, if MS-SQL and Oracle force Uppercase, and if I want the code to work most easily across
differentbackends then perhaps I should let it be the default values...  

and let the drivers... in this case ColdFusion lowercase everything for me...

and if I use Oracle in the future CF will uppercase them for me... (True Statement ?)  if true then I'm off and running
again.

Thanks for the feedback.

Daniel



At 06:01 PM 7/6/01 -0500, Ross J. Reedstrom wrote:
>On Fri, Jul 06, 2001 at 12:49:16PM -0700, Daniel Clark wrote:
>> Hi all,
>>
>> A very newbie question...
>>
>> Just started using ColdFusion5.0(Linux) against pgSQL(Linux7.1) using ODBC
>>
>> It seems that ColdFusion sends along LowerCase TableNames and ColumnNames to pgSQL even if I program the .cfm files
withMixedCase strings 
>>
>> The result is failure to locate tables and columns until I rename them in all lowercase.
>>
>> Is there some feature in pgSQL that can make it insensitive to case in tablenames and column names?
>>
>
>This is a required feature of ANSI SQL: case insensitivity. PostgreSQL
>implements this by downcasing all identifiers (Oracle, and MS-SQL,
>UPCASE EVERYTHING), unless they're quoted. I'm guessing your using some
>tool to create your MixedCase tablenames, and it's quoting them for you
>behind your back.
>
>So, either lose the quotes on the identifiers when you create the schema
>(i.e., let them get down cased) or write all your CF like so:
>
>select "SomeColumn"."SomeTable", "SomeOtherColumn"."SomeOtherTable" from
>"SomeTable","SomeOtherTable" ...
>
>Ross
>
>P.S. Yup, you have to quote each identifier seperately, not the dotted
>identifier. Because, according to the standard, once you quote it,
>anything goes, so "This.is my Really Weird_column.name" is completely
>valid.
>