Re: libpq PQexecParams & value placeholders

From: Dmitry Igrishin <dmitigr(at)gmail(dot)com>
To: lego12239(at)yandex(dot)ru
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: libpq PQexecParams & value placeholders
Date: 2018-12-14 11:47:12
Message-ID: CAAfz9KNzi26oUxuiJdiNB5-_mvddxjsiyLtP7GNKWkqEDtPNDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

пт, 14 дек. 2018 г. в 14:33, Oleg <lego12239(at)yandex(dot)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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg 2018-12-14 12:09:19 Re: libpq PQexecParams & value placeholders
Previous Message Oleg 2018-12-14 11:33:38 libpq PQexecParams & value placeholders