pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: String escaping?
Date: Thu, 14 Dec 2006 13:27:33 +0100
Message-ID: <20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com> (raw)
In-Reply-To: <4581318F.4030202@gtech-ua.com>
References: <50899926-5B68-42EC-B126-75EBC7E38BF4@mac.com>
	<4580368D.8070300@enterprisedb.com>
	<1166032066.27428.92.camel@archimedes>
	<20061214115414.2cff1417@kingfisher.sec.intern.logix-tt.com>
	<4581318F.4030202@gtech-ua.com>

Hi, Vit,

Vit Timchishin <tivvpgsqljdbc@gtech-ua.com> wrote:

> > I always thought that the Strings that I set with setString() don't
> > have to be escaped at all, the Driver will handle it transparently (by
> > either escaping for V2 protocol, or using BIND with the appropriate
> > encoding).
> >
> > But, of course, when I have a String Literal in the source, I need to
> > add a layer of Java escaping for ", \, and some others.
> >
> >   
> I suppose you've missed the main: "you need to escape only when you are
> using LIKE".

Yes, the LIKE specific escaping will stay there, but that layer is
independent of statement-level escaping.

What I wanted to show was: When you create your queries via String
concatenation, you have to implement the statement-level escaping
yourself, with prepared statements, the driver should completely handle
it.

That's independent of source-level escaping for String literals in
Java, and function-specific escaping inside the text for LIKE or
strings in function definitions.



Regards,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



view thread (6+ messages)

Message-ID: <20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com>
Permalink:  ../20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com/
Also on:    postgresql.org/message-id/20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: schabi@logix-tt.com
  Subject: Re: String escaping?
  In-Reply-To: <20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com>
  References: <50899926-5B68-42EC-B126-75EBC7E38BF4@mac.com> <4580368D.8070300@enterprisedb.com> <1166032066.27428.92.camel@archimedes> <20061214115414.2cff1417@kingfisher.sec.intern.logix-tt.com> <4581318F.4030202@gtech-ua.com> <20061214132733.709740ba@kingfisher.sec.intern.logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox