pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
possible parser error
2+ messages / 2 participants
[nested] [flat]

* possible parser error
@ 1999-06-25 21:07  Kyle Bateman <kyle@actarg.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Kyle Bateman @ 1999-06-25 21:07 UTC (permalink / raw)
  To: pgsql-sql

I'm using v6.5.  I found out accidentally that the query:

update table set field = value' where key = keyvalue;          --notice
the accidental tick

silently ignores everything after the tick and does not generate any
kind of syntax error.
This quietly clobbered a table by updating the field in every record in
the table.  (The where
clause was ignored.)

The tick shouldn't have been there, it was just a typing error.  But
unless I'm missing something,
it seems like it would be good to generate an error like "Unmatched
quotes" or some such thing.

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: possible parser error
@ 2000-04-22 03:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kyle Bateman <kyle@actarg.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2000-04-22 03:52 UTC (permalink / raw)
  To: Kyle Bateman <kyle@actarg.com>; +Cc: pgsql-sql

(I'm cleaning out old email tonight...)

A good long while ago, you wrote:
> I'm using v6.5.  I found out accidentally that the query:

> update table set field = value' where key = keyvalue;          --notice
> the accidental tick

> silently ignores everything after the tick and does not generate any
> kind of syntax error.  This quietly clobbered a table by updating the
> field in every record in the table.  (The where clause was ignored.)

> The tick shouldn't have been there, it was just a typing error.  But
> unless I'm missing something, it seems like it would be good to
> generate an error like "Unmatched quotes" or some such thing.

FWIW, this is fixed in 7.0.  I do not believe it's possible to make
this sort of mistake in psql (because psql won't send an incomplete
quoted string to the backend), but it's surely possible in other
interfaces or when using libpq directly.  7.0 gives:

ERROR:  Unterminated quoted string

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-04-22 03:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-25 21:07 possible parser error Kyle Bateman <kyle@actarg.com>
2000-04-22 03:52 ` Tom Lane <tgl@sss.pgh.pa.us>

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