Re: [PORTS] Port Bug Report: parse error not detected onunterminated quote

From: Kyle Bateman <kyle(at)actarg(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Subject: Re: [PORTS] Port Bug Report: parse error not detected onunterminated quote
Date: 1999-06-30 14:36:55
Message-ID: 377A2B87.AF707E46@actarg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports pgsql-sql

Herouth Maoz wrote:

> At 16:31 +0300 on 30/06/1999, Thomas Lockhart wrote:
>
> > And seems to be:
> >
> > postgres=> select * from mytable' where id = 1234;
> > postgres'> '
> > postgres-> ;
> > ERROR: parser: parse error at or near "'"
> > postgres=>
> >
> > This is on a RH5.2 system with with the cvs distribution of Postgres
> > (rather than v6.5 exactly). But the parsing behavior should be the
> > same. I'm not sure what could be different in our installations...
>
> In psql, it will probably never be a problem, because it demands that you
> close the quotation mark (that "postgres'>" prompt). It doesn't send
> anything to the backend until you have closed the quotation and type \g or
> ';'.
>
> But what happens if the above query is sent through one of the other
> interfaces, like pqlib?
>

I did a little more testing on it.

When running pqsl in interactive mode, everything works out OK. Pqsl insists
on getting the last terminating quote. However, if you enter:

psql mydb -c "select * from mytable' where id = 1234;"

you get the whole table, not just the one record. I first noticed the
problem using the TCL interface so I know it exists there as well as in
non-interactive psql.

--
----------------------------------------------------
Kyle Bateman President, Action Target Inc.
"Viva Yo!" kyle(at)actarg(dot)com (801)377-8033x101
----------------------------------------------------

In response to

Browse pgsql-ports by date

  From Date Subject
Next Message Thomas Lockhart 1999-06-30 15:07:05 [Fwd: [PORTS] Port Bug Report: parse error not detected on unterminated quote]
Previous Message Herouth Maoz 1999-06-30 14:19:28 Re: [PORTS] Port Bug Report: parse error not detected on unterminated quote

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-06-30 14:43:55 Re: [SQL] Beginner's headache of joins
Previous Message Tom Lane 1999-06-30 14:28:51 Re: [SQL] More fun with random selects