[OpenSIPS-Devel] [ opensips-Bugs-3486381 ] db_postgres key word as column name handling

SourceForge.net noreply at sourceforge.net
Wed Mar 21 16:57:26 CET 2012


Bugs item #3486381, was opened at 2012-02-09 12:06
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3486381&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: Open
>Resolution: Later
>Priority: 3
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Alexandr Dubovikov (adubovikov)
Summary: db_postgres key word as column name handling

Initial Comment:
sipcapture uses a column name authorization which in postgresql is a reserved word. I made it work by changing the column name to auth.
Postgresql uses double-quotes to identify a "delimited identifier or quoted identifier" (http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html).
 "A delimited identifier is always an identifier, never a key word."
It can be used on table names column names index names etc.
It solves other problems such as capitals in names as well.
MySQL uses ` (back tick) for the same thing. I don't know about other databases.

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

Comment By: Alexandr Dubovikov (adubovikov)
Date: 2012-03-16 09:29

Message:
Hi Vladut,

sure, I want to fix, but at this moment I see only one way, make
double-quotes for "authorization" field in case if user use PosgtressqlDB.
It will also correct way for another modules with posgreSql support.

Wbr,
Alexandr

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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-03-16 03:53

Message:
Hi,

Can you please fix this, as the release for 1.8 is quite soon.

Thanks and Regards,
Vlad

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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-02-15 03:27

Message:
Hi,

Sorry, I was under the impression that the sipcapture module used the
default OpenSIPS DB. In that case, you can't really use the default DB
schema, as that also takes care of the versioning of the DB tables. 

I have assigned the bug to you.

Regards,
Vlad


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

Comment By: Alexandr Dubovikov (adubovikov)
Date: 2012-02-14 02:30

Message:
Hi Vladut,

ok, I can go this way, but the sipcapture module doesn't use default
opensips DB. Is it ok for current scripts ?

Can you please asign this bug on me ?

Wbr,
Alexandr

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

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-02-14 02:19

Message:
Hi Alexandr,

I have noticed that the sipcapture module does not include a proper DB
schema. All other modules that need a DB connection, have an XML defined DB
schema located in the db/schema folder in the OpenSIPS sources root. 
After that, the XML schema can be used to generate SQL files for various
back-ends, like mysql, postgres, oracle, etc. The scripts are generated in
scripts/mysql/ for mysql, etc.

Can you please follow the same pattern for DB schemas ?

Regards,
Vlad


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

Comment By: Alexandr Dubovikov (adubovikov)
Date: 2012-02-14 02:00

Message:
can we still use "authorization" column with "double-quotes" ? 
I can make changes for Webhomer, but not sure about db_postgress in
opensips.



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

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



More information about the Devel mailing list