Re: How to retrieve column names for tables with underscores

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to retrieve column names for tables with underscores
Date: 2011-03-24 20:45:13
Message-ID: imgagk$h4a$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote on 24.03.2011 21:18:
>> Am Donnerstag, 24. M?rz 2011 schrieb Thomas Kellerer:
>>> backslash escape ("table1\_") but that didn't work.
>> IMHO it should be "table1\\_"?
>>
>
> The escape needed depends on the value of standard_conforming_strings. You should use this call to find the escape needed:
>
> http://download.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getSearchStringEscape()
>
That works perfectly.

Actually the fact that "it didn't work" right way was that I used replaceAll() instead of replace() somehow forgetting that replaceAll() needs a regex...

Interesting enough, the setting of standard_conforming_strings does not seem to affect this at all. Am I missing something?

Thanks
Thomas

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2011-03-24 21:02:07 Re: How to retrieve column names for tables with underscores
Previous Message Kris Jurka 2011-03-24 20:18:17 Re: How to retrieve column names for tables with underscores