Skip site navigation (1) Skip section navigation (2)

Re: possible parser error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kyle Bateman <kyle(at)actarg(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: possible parser error
Date: 2000-04-22 03:52:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

In response to

pgsql-sql by date

Next:From: Jan WieckDate: 2000-04-22 08:45:33
Subject: Re: TOAST (was: BLOB)
Previous:From: Matthew DennyDate: 2000-04-22 00:33:08
Subject: question on UPDATE rules

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group