Hi Maxim,

no problem, I apologize it took longer than I had promised, but I
encountered several problems in the client library of PostgreSQL while
working on the driver. The library indeed has rough edges, compared to
the mysql client library. Nevertheless the driver should be working now.

There are some improvements over previous versions of the driver that
are probably worth mentioning:

* The driver is using prepared statements for all queries. The advantage
  of prepared queries is that they are sent to the server and planned
  only once (during ser startup and after every reconnect) and executed
  multiple times. Prepared queries are typically faster than normal
  queries, although I have no performance numbers for the postgres
  driver in hand at the moment.

* PostgreSQL OIDs are no more hardwired into the driver, instead they
  are downloaded from the server's system catalogs after the initial
  connect. With this improvement you can connect to multiple PostgreSQL
  servers even if they use different OIDs. Also this improvements makes
  it easy to implement support for additional/custom data types.

* Field conversion functions are much more flexible than their
  counterparts in the previous version of the driver. So the drivers is
  less picky about the database schema.

* When performing field type checking, the driver downloads column types
  of the columns being used from the server and tries to match them with
  field types used in SER. This is a major improvement over previous
  driver versions which required the types to match precisely.

* The driver supports more column types: int2, int4, int8, bool, inet,
  timestamp, bit, varbit, float4, float8, bpchar, char, text, varchar.


I also updated the database schema for PostgreSQL to make sure it works
out of the box. There will be more changes to the schema though, I would
like to change all fields that store IP addresses from integer to inet,
for example.

The main configuration file ser-oob.cfg is also updated, all raw SQL
queries in the configuration file now have their PostgreSQL counterparts
that are commented out. This way the configuration file should be easily
usable with PostgreSQL.

Here is a list of things that are still missing and are on the todo list:

* No support for INSERT OR UPDATE (or REPLACE in MySQL). PostgreSQL does
  not seem to support "insert or update" type of queries, so I will have
  to re-implement it using transactions somehow. I am not yet sure
  exactly how, so suggestions/patches/code are welcome.

* I haven't tested the reconnecting code, I took it from mysql where it
  works, so hopefully it will work well in this driver too, I'll do more
  testing when I have some time.

* ser_ctl (the python scripts) currently do not work with postgres. They
  contain some SQL queries that the server refuses, I'll have to look
  into this (it has already been reported in the bug tracker).

It would really help if you could test the driver and provide me with
some feedback. If you find a bug or problem please send an email to
serdev and put my private email address on the CC list too, I can
hopefully fix bugs quickly.

  Jan.

Maxim Sobolev wrote:
> Thank, you, Jan! I will try to give it a try in the next few days.
> 
> -Maxim
> 
> Jan Janak wrote:
>> janakj      2008/05/05 17:07:06 CEST
>>
>>   SER CVS Repository
>>
>>   Modified files:
>>     modules/postgres     Makefile pg_con.c pg_con.h 
>>   Added files:
>>     modules/postgres     pg_cmd.c pg_cmd.h pg_fld.c pg_fld.h 
>>                          pg_mod.c pg_mod.h pg_oid.c pg_oid.h 
>>                          pg_res.c pg_res.h pg_sql.c pg_sql.h 
>>                          pg_uri.c pg_uri.h 
>>   Log:
>>   - New postgres driver for the new db api in ser
>>   - Support for prepared statements
>>   - Support for oid retrievals from system catalogs
>>   - More flexible data type conversion
>>   - Support for inet data fields
>>   
>>   Revision  Changes    Path
>>   1.10      +2 -1      sip_router/modules/postgres/Makefile
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/Makefile.diff?r1=1.9&r2=1.10
>>   1.1       +509 -0    sip_router/modules/postgres/pg_cmd.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_cmd.c?rev=1.1&content-type=text/plain
>>   1.1       +154 -0    sip_router/modules/postgres/pg_cmd.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_cmd.h?rev=1.1&content-type=text/plain
>>   1.3       +238 -119  sip_router/modules/postgres/pg_con.c
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_con.c.diff?r1=1.2&r2=1.3
>>   1.3       +75 -45    sip_router/modules/postgres/pg_con.h
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_con.h.diff?r1=1.2&r2=1.3
>>   1.1       +834 -0    sip_router/modules/postgres/pg_fld.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_fld.c?rev=1.1&content-type=text/plain
>>   1.1       +146 -0    sip_router/modules/postgres/pg_fld.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_fld.h?rev=1.1&content-type=text/plain
>>   1.1       +535 -0    sip_router/modules/postgres/pg_mod.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_mod.c?rev=1.1&content-type=text/plain
>>   1.1       +47 -0     sip_router/modules/postgres/pg_mod.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_mod.h?rev=1.1&content-type=text/plain
>>   1.1       +184 -0    sip_router/modules/postgres/pg_oid.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_oid.c?rev=1.1&content-type=text/plain
>>   1.1       +128 -0    sip_router/modules/postgres/pg_oid.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_oid.h?rev=1.1&content-type=text/plain
>>   1.1       +76 -0     sip_router/modules/postgres/pg_res.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_res.c?rev=1.1&content-type=text/plain
>>   1.1       +58 -0     sip_router/modules/postgres/pg_res.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_res.h?rev=1.1&content-type=text/plain
>>   1.1       +424 -0    sip_router/modules/postgres/pg_sql.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_sql.c?rev=1.1&content-type=text/plain
>>   1.1       +118 -0    sip_router/modules/postgres/pg_sql.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_sql.h?rev=1.1&content-type=text/plain
>>   1.1       +292 -0    sip_router/modules/postgres/pg_uri.c (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_uri.c?rev=1.1&content-type=text/plain
>>   1.1       +71 -0     sip_router/modules/postgres/pg_uri.h (new)
>> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ser/sip_router/modules/postgres/pg_uri.h?rev=1.1&content-type=text/plain
>> _______________________________________________
>> Serdev mailing list
>> [email protected]
>> http://lists.iptel.org/mailman/listinfo/serdev
>>
> 
> _______________________________________________
> Serdev mailing list
> [email protected]
> http://lists.iptel.org/mailman/listinfo/serdev

_______________________________________________
Serdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/serdev

Reply via email to