From: Carlos Abalde <carlos@lfcia.org>
To: pgsql-odbc@postgresql.org
Cc: Håkon Clausen <hakonhc@nospam.hclausen.net>
Subject: Re: Help with DELETE statement via ODBC
Date: Mon, 7 Jun 2004 22:13:41 +0200
Message-ID: <20040607201341.GA5962@lfcia.org> (raw)
In-Reply-To: <opr87soaoy1y0472@news.postgresql.org>
References: <20040531171916.GA30749@lfcia.org>
<opr87soaoy1y0472@news.postgresql.org>
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 |
+-.---.---.---.---.---.---.---.---.-+-.---.---.---.---.---.---.---.-+
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: carlos@lfcia.org, hakonhc@nospam.hclausen.net
Subject: Re: Help with DELETE statement via ODBC
In-Reply-To: <20040607201341.GA5962@lfcia.org>
References: <20040531171916.GA30749@lfcia.org> <opr87soaoy1y0472@news.postgresql.org> <20040607201341.GA5962@lfcia.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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