Quoting routines in libpq

Started by Denis Perchineover 25 years ago4 messagesgeneral
Jump to latest
#1Denis Perchine
dyp@perchine.com

Hello,

Just a small question: why there is not any quoting routine in libpq.
This is very handy to have one. And also it is quite hard always
write quoting routing for database if you want to have cross database code.

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Denis Perchine (#1)
Re: Quoting routines in libpq

Denis Perchine writes:

Just a small question: why there is not any quoting routine in libpq.

Can you give an example of what it should do?

--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden

#3Vince Vielhaber
vev@michvhf.com
In reply to: Peter Eisentraut (#2)
Re: Quoting routines in libpq

On Tue, 18 Jul 2000, Peter Eisentraut wrote:

Denis Perchine writes:

Just a small question: why there is not any quoting routine in libpq.

Can you give an example of what it should do?

Just as a guess, something that parses a string and escapes single quotes,
backslashes and stuff like that. I rolled my own for apps that I worked
on that needed one, lately I've been using PHP which has such a function
and a reversing function.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net
128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directory http://www.camping-usa.com
Online Giftshop Superstore http://www.cloudninegifts.com
==========================================================================

#4Denis Perchine
dyp@perchine.com
In reply to: Vince Vielhaber (#3)
Re: Quoting routines in libpq

Just a small question: why there is not any quoting routine in libpq.

Can you give an example of what it should do?

Just as a guess, something that parses a string and escapes single quotes,
backslashes and stuff like that. I rolled my own for apps that I worked
on that needed one, lately I've been using PHP which has such a function
and a reversing function.

You are perfectly right!!! :-)))) Problem is that for each database you should escape
their own set of chars. And also there are lots of escaping types. Like some DBs
prefer to escape single quote as two single quotes, some as slash and single quote.

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------