Re: Positional parameters and question mark notation

Поиск
Список
Период
Сортировка
От Andreas Lubensky
Тема Re: Positional parameters and question mark notation
Дата
Msg-id 1390212912.25173.155.camel@aries.cognitec-systems.de
обсуждение исходный текст
Ответ на Re: Positional parameters and question mark notation  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-general
Hi Dmitriy,

I considered just doing a string replacement, however this might be
potentially dangerous because in theory a query might contain a question
mark as part of a string or similar. Although I'm certain it would work
for us at the moment, it looks like a problem waiting to happen. Doing a
proper replacement (as ODBC probably does) most likely requires a full
blown SQL parser...

On Mon, 2014-01-20 at 14:08 +0400, Dmitriy Igrishin wrote:
> Hey Andreas,
>
>
> 2014/1/20 Andreas Lubensky <lubensky@cognitec.com>
>         Hi,
>
>         Is there any way to make PostgreSQL support the question mark
>         (?)
>         notation instead of the dollar sign ($1, $2...) for prepared
>         statements?
>         Most databases use the question mark notation and we have a
>         set of
>         simple queries that are supposed to be portable across
>         different
>         database systems. So far we use PostgreSQL via ODBC, but now
>         we want to
>         switch to a native libpq implementation.
> I believe that C-function for replacing '?' with '$n' can easily
> implemented
> in the application code. Or you may want to look at libpqtypes:
> http://libpqtypes.esilo.com/
>
> Or (if you are C++) you may want to look at SOCI:
> http://soci.sourceforge.net/
>
>
> --
> // Dmitriy.
>
>

--
with best regards,

Andreas Lubensky



В списке pgsql-general по дате отправления:

Предыдущее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Positional parameters and question mark notation
Следующее
От: Marti Raudsepp
Дата:
Сообщение: Re: json_array_elements_text?