Re: Protection from SQL injection - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Protection from SQL injection
Date
Msg-id 20080430205834.GB3125@svana.org
Whole thread Raw
In response to Re: Protection from SQL injection  (Andrew Sullivan <ajs@commandprompt.com>)
Responses Re: Protection from SQL injection  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Apr 30, 2008 at 10:20:09AM -0400, Andrew Sullivan wrote:
> On Tue, Apr 29, 2008 at 09:02:30PM -0400, Gregory Stark wrote:
> > Did you guys miss Tom's comment up-thread? Postgres already does this if you
> > use PQExecParams().
>
> I did, yes.  Thanks for the clue.  OTOH, I do see the OP's point that
> it'd be nice if the DBA could enforce this rule.  Maybe a way of
> insisting on PQExecParams() instead of anything else?

Create a function somewhere:

void PQexec()
{ die();
}

And it will override the one in the shared library. In other languages
subclassing should be able to provide the same effect.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Bryce Nesbitt
Date:
Subject: Re: Proposed patch - psql wraps at window width
Next
From: Tom Lane
Date:
Subject: Re: TidScan needs handling of a corner cases