Re: PATCH: Postgresql Patch

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization tolj.org system architecture
Message-ID <[email protected]>
Guillaume Cottenceau schrieb:
> "Hillel" <hillel 'at' ecommunicate.biz> writes:
> 
>> Hi Kannel Devel,
>>
>> Attached and included in this email, is a postgresql patch that does not use
>> Automatic OIDs, which has been removed from Postgresql.
>>
>> You can make smsc,ts the primary key or as suggested by Guillaume Cottenceau
>> you can set smsc,ts as an index.
>>
>> diff -u gateway/gw/dlr_pgsql.c gateway/gw/dlr_pgsql.c
>> --- gateway/gw/dlr_pgsql.c      2008-06-23 08:16:34.000000000 +0200
>> +++ gateway/gw/dlr_pgsql.c   2008-06-22 12:27:38.000000000 +0200
>> @@ -220,12 +220,11 @@
>>      Octstr *sql;
>>
>>      debug("dlr.pgsql", 0, "removing DLR from database");
>> -    sql = octstr_format("DELETE FROM %s WHERE (%s,%s) IN (SELECT %s,%s
>> WHERE %s='%s' AND %s='%s' LIMIT 1);",
> 
> The general contract of the code at that point is to delete only
> one row even if there are multiple smsc,ts rows, which your
> change breaks.
> 
> dn=# create table foo ( bar int, baz int );
> CREATE TABLE
> dn=# insert into foo ( bar, baz ) values ( 1, 2 );
> INSERT 447809901 1
> dn=# insert into foo ( bar, baz ) values ( 1, 2 );
> INSERT 447809902 1
> dn=# delete from foo where ( bar, baz ) in ( select 1, 2 limit 1 );
> DELETE 2
> 
> Same for the UPDATE statement, actually.

So this shall be a -1 vote by Guillaume I guess.

Hillel, can you please revise and update the patch?

Stipe

-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany

tolj.org system architecture      Kannel Software Foundation (KSF)
http://www.tolj.org/              http://www.kannel.org/

mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.