[ opensips-Bugs-2814081 ] db modules for postgres named incorrectly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ opensips-Bugs-2814081 ] db modules for postgres named incorrectly

SourceForge.net
Bugs item #2814081, was opened at 2009-06-29 19:05
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2814081&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
>Status: Closed
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Gordon Ross (gordonross)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: db modules for postgres named incorrectly

Initial Comment:
The db_postgres module does not work in it's current incarnation in both trunk & 1.5.1

If you try and use postgres support out of the box, you get the following error:

"ERROR:core:db_check_api: module db_pgsql does not export db_use_table function"

The module is called pg_postgres, but the DB APIs assume pgsql. From my *very* brief look at the code, the core DB API routines assume the module name and the API name are the same. However, they are not in this case.

By changing the Makefile (to produce db_pgsql.so) and modifying pg_postgres.c line 55 to be "db_pgsql" rather than "db_postgres", you can then put

loadmodule "db_pgsql.so"

and DB URIs of:

"pgsql://opensips:opensipsrw@localhost/opensips"

Postgres support will then work with OpenSIPS.

This is just a dirty hack, though. The module directory name needs changing, and the db_postgres.c needs renaming to pg_pgsql.c, plus the Makefile needs updating as well.

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-06-29 20:05

Message:
This will be moved in a Feature Request for making the names more
consistent when comes to Postgres.

----------------------------------------------------------------------

Comment By: Gordon Ross (gordonross)
Date: 2009-06-29 19:22

Message:
The problem with OpenSIPS & Postgres support, is that naming is NOT
consistent.

In some places postgres support is referenced by the name "PGSQL" and in
others it's by "postgres"

A decision needs to be made as to what postgres is called, and then stick
to it !

My hack to change it to pgsql makes it more consistent with the other
config parameters. If you wish it to be postgres, then change all the other
files.

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-06-29 19:19

Message:
But a postgres URL should look like:

   "postgres://opensips:opensipsrw@localhost/opensips"

This is the intended way of using the postgres DB.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2814081&group_id=232389

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel