Printf-like function

Started by Igor Korotover 3 years ago3 messagesgeneral
Jump to latest
#1Igor Korot
ikorot01@gmail.com

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.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Igor Korot (#1)
Re: Printf-like function

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

#3Igor Korot
ikorot01@gmail.com
In reply to: Tom Lane (#2)
Re: Printf-like function

Thank you.

Show quoted text

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