Re: Special characters in SQL queries

From: "Victor Yegorov" <viy(at)pirmabanka(dot)lv>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Special characters in SQL queries
Date: 2003-03-12 06:44:19
Message-ID: 20030312064419.GG3791@pirmabanka.lv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

* Vernon Wu <vernonw(at)gatewaytech(dot)com> [12.03.2003 05:36]:
> Thank Christoph for your information.
>
> 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
> solution, I believe.
>
> 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
> in text. Who know what characters a user will enter.
>

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);

--

Victor Yegorov

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Muhammad Shariq Muzaffar 2003-03-12 07:21:22 SERIAL does not ROLLBACK
Previous Message Andre Schubert 2003-03-12 06:27:45 Re: Help on indexing timestamps