pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaleb Akalework <kaleb.akalework@asg.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: BUG #15632: Correctly escaped strings are mishandled in function
Date: Mon, 11 Feb 2019 18:28:00 +0000
Message-ID: <29f41d36b0c6442c853eec253df061ea@asg.com> (raw)
In-Reply-To: <CAKFQuwbLQMgEiVH=W4_4zHvNMd90+HPhs3ZiYCvQFZE5Q7uMcQ@mail.gmail.com>
References: <15632-d3748195ebf6f4cd@postgresql.org>
	<CAKFQuwbLQMgEiVH=W4_4zHvNMd90+HPhs3ZiYCvQFZE5Q7uMcQ@mail.gmail.com>

The actual error I get is error: -42 42601 syntax error at or near "SOLD". Because it removed the double single quote.

-----Original Message-----
From: David G. Johnston <david.g.johnston@gmail.com> 
Sent: Monday, February 11, 2019 1:19 PM
To: Kaleb Akalework <kaleb.akalework@asg.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15632: Correctly escaped strings are mishandled in function

*** External email: Verify sender before opening attachments or links ***


On Mon, Feb 11, 2019 at 11:04 AM PG Bug reporting form <noreply@postgresql.org> wrote:
> I'm working on a Java app, and I used prepared statements to create a 
> function call to postgressql.

PostgreSQL (one s)...

> Inside my function I take these parameters and build a query like this
>  WITH upd AS (  UPDATE topic$_dept  SET topic_value =  'SOLD''   WHERE
> topic_value = 'SOLD'  RETURNING 1 )  SELECT COUNT(*) FROM upd

I doubt this is a bug but rather likely you are not doing something correctly here.  But since you don't show the function its impossible to say what.

> This will throw an error

How hard is it to include the actual error?

David J.


view thread (8+ messages)  latest in thread

Message-ID: <29f41d36b0c6442c853eec253df061ea@asg.com>
Permalink:  ../29f41d36b0c6442c853eec253df061ea@asg.com/
Also on:    postgresql.org/message-id/29f41d36b0c6442c853eec253df061ea@asg.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-bugs@postgresql.org
  Cc: kaleb.akalework@asg.com, david.g.johnston@gmail.com
  Subject: Re: BUG #15632: Correctly escaped strings are mishandled in function
  In-Reply-To: <29f41d36b0c6442c853eec253df061ea@asg.com>
  References: <15632-d3748195ebf6f4cd@postgresql.org> <CAKFQuwbLQMgEiVH=W4_4zHvNMd90+HPhs3ZiYCvQFZE5Q7uMcQ@mail.gmail.com> <29f41d36b0c6442c853eec253df061ea@asg.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