From kyle@actarg.com Fri Jun 25 21:02:47 1999 Received: from www.actarg.com (root@[209.180.91.25]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA04581 for ; Fri, 25 Jun 1999 17:02:47 -0400 (EDT) (envelope-from kyle@actarg.com) Received: from actarg.com (root@tao.actarg.com [192.168.1.1]) by www.actarg.com (8.8.7/8.8.7) with ESMTP id PAA09689 for ; Fri, 25 Jun 1999 15:05:28 -0600 Received: from actarg.com (kyle@chi.actarg.com [192.168.2.16]) by actarg.com (8.8.7/8.8.7) with ESMTP id PAA16768 for ; Fri, 25 Jun 1999 15:03:21 -0600 Sender: kyle@actarg.com Message-ID: <3773EFA9.F354E501@actarg.com> Date: Fri, 25 Jun 1999 15:07:53 -0600 From: Kyle Bateman Organization: Action Target Inc X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: possible parser error Content-Type: multipart/alternative; boundary="------------A17146A7A58F845A617D6D94" --------------A17146A7A58F845A617D6D94 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 ---------------------------------------------------- --------------A17146A7A58F845A617D6D94 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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
 ----------------------------------------------------
  --------------A17146A7A58F845A617D6D94-- From tgl@sss.pgh.pa.us Sat Apr 22 03:53:02 2000 Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA49411 for ; Fri, 21 Apr 2000 23:53:02 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id XAA24409; Fri, 21 Apr 2000 23:52:44 -0400 (EDT) To: Kyle Bateman cc: pgsql-sql@postgreSQL.org Subject: Re: possible parser error In-reply-to: <3773EFA9.F354E501@actarg.com> References: <3773EFA9.F354E501@actarg.com> Comments: In-reply-to Kyle Bateman message dated "Fri, 25 Jun 1999 15:07:53 -0600" Date: Fri, 21 Apr 2000 23:52:44 -0400 Message-ID: <24406.956375564@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200004/250 (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