X-Original-To: pgsql-sql@postgresql.org Received: from shield.pirmabanka.lv (unknown [195.114.57.4]) by postgresql.org (Postfix) with ESMTP id 80464475FBA for ; Wed, 12 Mar 2003 01:43:25 -0500 (EST) Received: from wall2.pirmabanka.lv (wall2-pub.pirmabanka.lv [195.114.57.14]) by shield.pirmabanka.lv (8.12.8/8.9.3) with SMTP id h2C6hOpn010634 for ; Wed, 12 Mar 2003 08:43:24 +0200 Received: from share.pirmabanka.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Wed, 12 Mar 2003 08:43:23 +0200 (EET) Received: from pc311x1.pirmabanka.lv (localhost.localdomain [127.0.0.1]) by pirmabanka.lv (8.11.6/8.11.6) with SMTP id h2C6hMi24574 for ; Wed, 12 Mar 2003 08:43:22 +0200 Received: (qmail 6335 invoked by uid 100); 12 Mar 2003 06:44:19 -0000 Date: Wed, 12 Mar 2003 08:44:19 +0200 From: "Victor Yegorov" To: pgsql-sql@postgresql.org Subject: Re: Special characters in SQL queries Message-ID: <20030312064419.GG3791@pirmabanka.lv> Mail-Followup-To: pgsql-sql@postgresql.org References: <3E6E0191.B8F06EBB@rodos.fzk.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5dNcufZ4prhark0F" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Archive-Number: 200303/277 X-Sequence-Number: 12317 --5dNcufZ4prhark0F Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Vernon Wu [12.03.2003 05:36]: > Thank Christoph for your information. >=20 > I don't program in C at all, but Java. Although I can make a way to call = the C library function from Java, it isn't suitable=20 > solution, I believe. >=20 > I only desire to find out all the type of characters at the present time = so that I can strip out any potential problem sources=20 > in text. Who know what characters a user will enter. >=20 Take a look at the source code of PQescapeString() in the source distribution of postgres. I hope, you'll find all the chars you're interested in. > >> > >> First a single quote in text, when a backforward slash in a file path, > >what other special characters need padded in t > >wo > >> backslashes before using the data in a SQL statement? > >> > >> After hours' search in the PostgreSQL archive, I find a releted > >information on the http://www.ca.postgresql.org/users > >- > >> lounge/docs/7.2/postgres/arrays.html. It's about array data though. > >> > >> How can I find out those characters so that I can pre-process them > >before a SQL query? > >> > >What about > >size_t PQescapeString (char *to, const char *from, size_t length); --=20 Victor Yegorov --5dNcufZ4prhark0F Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+btdC2RKGLEykUDYRAl+yAKCRpzbOBteoytSlEStf30Kh/g1pDACgwI+j Az+sF5qRRstEDv5CUN4Dju8= =wsBF -----END PGP SIGNATURE----- --5dNcufZ4prhark0F--