pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedPrintf-like function
3+ messages / 2 participants
[nested] [flat]
* Printf-like function
@ 2022-11-12 05:07 Igor Korot <ikorot01@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Igor Korot @ 2022-11-12 05:07 UTC (permalink / raw)
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi, ALL,
Is there a printf-lilke function inside libpq that can be used
to create a proper query string with the proper quoting of the
literal?
Or I will need to use sprintf()?
Thank you.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Printf-like function
@ 2022-11-12 05:12 Tom Lane <tgl@sss.pgh.pa.us>
parent: Igor Korot <ikorot01@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2022-11-12 05:12 UTC (permalink / raw)
To: Igor Korot <ikorot01@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Igor Korot <ikorot01@gmail.com> writes:
> Is there a printf-lilke function inside libpq that can be used
> to create a proper query string with the proper quoting of the
> literal?
No. You'd be better off to transmit the literal value as a
parameter.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Printf-like function
@ 2022-11-12 05:13 Igor Korot <ikorot01@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Igor Korot @ 2022-11-12 05:13 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Thank you.
On Fri, Nov 11, 2022 at 11:12 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Igor Korot <ikorot01@gmail.com> writes:
> > Is there a printf-lilke function inside libpq that can be used
> > to create a proper query string with the proper quoting of the
> > literal?
>
> No. You'd be better off to transmit the literal value as a
> parameter.
>
> regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-11-12 05:13 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12 05:07 Printf-like function Igor Korot <ikorot01@gmail.com>
2022-11-12 05:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-11-12 05:13 ` Igor Korot <ikorot01@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox