Re: text column constraint, newbie question - Mailing list pgsql-general

From David Wilson
Subject Re: text column constraint, newbie question
Date
Msg-id e7f9235d0903230051m38cabfbbk8852cf12f80085e6@mail.gmail.com
Whole thread Raw
In response to Re: text column constraint, newbie question  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
On Mon, Mar 23, 2009 at 3:07 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

> Are you saying pg_quer_params is MORE effective than pg_escape_string
> at deflecting SQL injection attacks?

pg_query_params() will protect non-strings. For instance, read a
number in from user input and do something of the form " and
foo=$my_number". Even if you escape the string, an attacker doesn't
need a ' to close a string, so he can manage injection. If it's " and
foo=$1" using pg_query_params(), however, that's not possible.

--
- David T. Wilson
david.t.wilson@gmail.com

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: text column constraint, newbie question
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: bash & postgres