#154 osipconsole broken for Postgres support

1.5.x
closed-fixed
Iulia Bublea
tools (25)
5
2009-07-10
2009-07-01
Gordon Ross
No

osipconsole uses the wrong quote character in it's SQL statements. osipconsole uses double quotes to enclose parameters. However, Postgres needs string parameters to be enclosed in single quotes. Double quotes, to postgres, indicate a colum name.

A simple add subscriber in osipconsole:

OpenSIPS$:add 1234@blah 1234
Used database is PostgreSQL
1234 blah
Entry could not be retrieved from tableERROR: column "1234" does not exist

Query results:

Retrieving user 1234@blah from dbaliases failedERROR: column "1234" does not exist

Query results:

Alias 1234@blah does not exist!
Introducing the new user 1234@blah to subscriber table failedERROR: column "1234" does not exist

This problem does not exist in opensipctl.That uses single quotes and works fine with Postgres.

# /usr/local/sbin/opensipsctl add 2345@blah 1234
pgsql_query: /usr/bin/psql -A -q -t -P fieldsep=' ' -h localhost -U opensips opensips -c 'insert into subscriber (username, domain,ha1,ha1b,password) values ('2345','blah','6bc52aec50b4af97f338b0d406234afa','5cb004acd453ef4e8548dfb19ab23ae4','1234');'
new user '2345@blah' added

Discussion

  • Iulia Bublea
    Iulia Bublea
    2009-07-02

    Hi,

    I have fixed this a couple of days ago, when another error was reported. It has been fixed on 1.5 and also on trunk. Please check if it works for you now.

    Regards,
    Iulia

     
    • assigned_to: nobody --> iulia_bublea
    • status: open --> open-fixed
     
  • Gordon Ross
    Gordon Ross
    2009-07-09

    Works fine in trunk now,

    Thanks.

     
  • Iulia Bublea
    Iulia Bublea
    2009-07-10

    • status: open-fixed --> closed-fixed