Re: libpq PQexecParams & value placeholders - Mailing list pgsql-general

From Dmitry Igrishin
Subject Re: libpq PQexecParams & value placeholders
Date
Msg-id CAAfz9KNzi26oUxuiJdiNB5-_mvddxjsiyLtP7GNKWkqEDtPNDQ@mail.gmail.com
Whole thread Raw
In response to libpq PQexecParams & value placeholders  (Oleg <lego12239@yandex.ru>)
Responses Re: libpq PQexecParams & value placeholders  (Oleg <lego12239@yandex.ru>)
List pgsql-general
пт, 14 дек. 2018 г. в 14:33, Oleg <lego12239@yandex.ru>:
>
> Hi, all.
>
> Do we really need a numeric value placeholders like $1 in command string?
It's a syntax defined at the backend side.
(https://www.postgresql.org/docs/current/sql-prepare.html)

> Construction of such string for complex non-static queries is very annoying.
That's why there are libraries like Pgfe
(https://github.com/dmitigr/pgfe) or libpqtypes
(http://libpqtypes.esilo.com/)

> Why do we can't simply use $$ placeholder, which take the next value from an
> array of values?
Because $$ means a dollar-quoted opening tag
(https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING)


pgsql-general by date:

Previous
From: Oleg
Date:
Subject: libpq PQexecParams & value placeholders
Next
From: Oleg
Date:
Subject: Re: libpq PQexecParams & value placeholders