[OpenSIPS-Devel] [ opensips-Bugs-3486381 ] db_postgres key word as column name handling
SourceForge.net
noreply at sourceforge.net
Tue Feb 14 11:19:57 CET 2012
Bugs item #3486381, was opened at 2012-02-09 12:06
Message generated for change (Comment added) made by vladut-paiu
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: Accepted
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Vladut-Stefan Paiu (vladut-paiu)
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: 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