Re: SQL safe input? - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: SQL safe input?
Date
Msg-id 20050826204415.GA11078@wolff.to
Whole thread Raw
In response to SQL safe input?  (cbraden <cbraden@douglasknight.com>)
Responses Re: SQL safe input?
Re: SQL safe input?
List pgsql-novice
On Fri, Aug 26, 2005 at 15:53:14 -0400,
  cbraden <cbraden@douglasknight.com> wrote:
> Folks,
>
> I would like to know how to prevent SQL attacks on a postgreSQL server.
>
> I know in mySQL you can put any input going to the DB through a filter
> which encodes anything which would be malicious into mySQL safe data.  I
> need something similar in postgreSQL.  Specifically as a php
> implementation if it exists.

IMO the best way to do this is to use bind parameters to pass user input
to queries. Then you don't need to escape anything. You might still check
for very long strings.

pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: SQL "OR" Problem
Next
From: Philip Hallstrom
Date:
Subject: Re: SQL safe input?