X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 10670D1B451 for ; Mon, 7 Jun 2004 17:13:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97725-08 for ; Mon, 7 Jun 2004 20:13:45 +0000 (GMT) Received: from orzan.fi.udc.es (orzan.fi.udc.es [193.144.60.19]) by svr1.postgresql.org (Postfix) with ESMTP id 795C4D1B188 for ; Mon, 7 Jun 2004 17:13:41 -0300 (ADT) Received: from anakin.lfcia.pri (laforge.dc.fi.udc.es [193.144.51.213]) by orzan.fi.udc.es (8.12.10/8.11.1) with ESMTP id i57KDfHr003441; Mon, 7 Jun 2004 22:13:41 +0200 (MEST) Received: from carlos by anakin.lfcia.pri with local (Exim 3.36 #1 (Debian)) id 1BXQV3-0004WC-00; Mon, 07 Jun 2004 22:13:41 +0200 Date: Mon, 7 Jun 2004 22:13:41 +0200 From: Carlos Abalde To: pgsql-odbc@postgresql.org Cc: =?iso-8859-1?Q?H=E5kon?= Clausen Subject: Re: Help with DELETE statement via ODBC Message-ID: <20040607201341.GA5962@lfcia.org> References: <20040531171916.GA30749@lfcia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-PGP-Key: http://www.lfcia.org/~carlos/pubkey.asc Organization: LFCIA Lab X-Operating-System: Linux 2.4.20-xfs i686 User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/13 X-Sequence-Number: 4083 Håkon Clausen wrote... > Hi Carlos, > > This is the correct behavior. Deleting 0 rows will give an ODBC error. > You will have to rewrite your query so that this does not occur. Hi Håkon, I'm not an expert on ODBC and maybe this is and philosophical discussion, buy I think that DELETE querys are very usual in DB applications, and querys like, DELETE FROM table WHERE field = foreign_key that are very common when you are working with 1-N relations, need a normal behaviour when 0 rows are deleted. For example, +---------+ 1 N +-----------+ | Formula |----------------| Parameter | +---------+ +-----------+ for_key par_key for_txt par_for (foreign key) ... par_nam par_val ... Represents a formula with several parameters. If we have a new list of parameters for a existing formula, the best way to update then is to delete the old parameters and create the new ones. With the current DELETE behaviour, the normal case of a formula without parameters must be considered as a special case! I think that there is a lot of examples like this in DB aplications. Moreover, as DBs are highly related with Set Theory, it's an error the current behaviour, because the empty set is dealed as a special case. These are the mains reasons I think the current behaviour is erroneus. However, as I said before, maybe this is a philosophical discussion :). Best regards, +---.---.---.---.---.---.---.---.---+---.---.---.---.---.---.---.---+ | Carlos Abalde (carlos@lfcia.org) | http://www.lfcia.org/~carlos | + LFCIA Lab, Dept. Computer Science | +34.981.167000 ext. 1275 + | University of A Coruna, Spain | PGP Key ID = 0x04DF0EAF | +-.---.---.---.---.---.---.---.---.-+-.---.---.---.---.---.---.---.-+