Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZG74e-0004aD-Gg for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Jul 2015 14:57:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZG74d-0001OX-Lk for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Jul 2015 14:57:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZG74H-0000yI-7O for pgsql-odbc@postgresql.org; Fri, 17 Jul 2015 14:56:53 +0000 Received: from mail.lurcherlink.org ([217.34.199.121] helo=mail.lurcher.org) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZG74D-0002xd-UA for pgsql-odbc@postgresql.org; Fri, 17 Jul 2015 14:56:52 +0000 Received: from [172.20.0.153] (hul.easysoft.local [172.20.0.153]) by mail.lurcher.org (8.14.3/8.12.8) with ESMTP id t6HEo1Ml026095; Fri, 17 Jul 2015 15:50:01 +0100 Message-ID: <55A917AB.3010802@lurcher.org> Date: Fri, 17 Jul 2015 15:56:43 +0100 From: Nick Gorham User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stefan Viljoen , pgsql-odbc@postgresql.org Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client References: <000b01d0c066$c58f3b80$50adb280$@verishare.co.za> <55A8BF02.4090001@lurcher.org> <002701d0c07f$bd09f3b0$371ddb10$@verishare.co.za> <55A8E0B8.3070107@lurcher.org> <002e01d0c088$c6b57390$54205ab0$@verishare.co.za> <55A8F948.9040407@lurcher.org> <002f01d0c090$da03cc50$8e0b64f0$@verishare.co.za> <55A905FA.2080701@aklaver.com> <003001d0c099$e21a7b60$a64f7220$@verishare.co.za> <55A90E6A.4030802@lurcher.org> <003201d0c09f$b1ece5d0$15c6b170$@verishare.co.za> In-Reply-To: <003201d0c09f$b1ece5d0$15c6b170$@verishare.co.za> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sipserver.lurcher.org X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 17/07/15 15:48, Stefan Viljoen wrote: > Hi Nick > >> Getting confused now. The above leads me to believe you should have >> Database = asteriskcdrcdrdb >> in the odbc.ini entry and connect as >> isql -v pgdb-cdr asteriskcdruser whateverthepasswordis >> I was assuming you were replacing dbuser, dbname and password with the real > ones for your situation. > > That is a typeo I made. You are correct, I'm replacing with the real ones - > made a typo. > > My odbc.ini actually is > > -- > [root@jhbasterisk pg_log]# vim /etc/odbc.ini > [ODBC Data Sources] > pgdb=PostgreSQL > > [asterisk-cdr] > Description=MySQL connector for Asterisk > Driver=MySQL > Database=asteriskcdrdb > Socket=/var/lib/mysql/mysql.sock > > [pgdb-cdr] > ;Driver = /usr/pgsql-9.4/lib/psqlodbc.so > Driver=PostgreSQL > ServerName=localhost > Port=5432 > UserName=dbuser > Password=dbpassword > Database=dbname > ReadOnly=No > Protocol=9.4 > Trace=Yes > TraceFile=/tmp/sql.log > ConnSettings= > DSN=pgdb > ServerType=Postgres > Debug=1 > DebugFile=/var/log/postgresql_debug.log > -- > > e. g. I have now checked that the symantic > > dbname > > is NOT > > dbnamedname > > If I do > > [root@jhbasterisk pg_log]# isql -v pgdb-cdr dbuser dbpassword > [S1000][unixODBC]The database does not exist on the server > or user authentication failed. > [ISQL]ERROR: Could not SQLConnect > [root@jhbasterisk pg_log]# > > The interesting thing is if I change > > Database=dbname > > to symantic > > Database=dnam > > (e. g. leave out the last char) > > isql does this: > > [root@jhbasterisk pg_log]# isql -v pgdb-cdr asteriskcdruser 1ndestruc# > [08S01][unixODBC]Could not send Query(connection dead) > [ISQL]ERROR: Could not SQLConnect > [root@jhbasterisk pg_log]# > > So, my theory that unixODBC is not trying to connect or get far enough to > even touch Postgres is incorrect... therefore is DOES appear that it IS > postgress that is rejecting the ODBC connections? > > Kind regards > > Stefan > Its getting past the driver manager to the driver in all cases, those errors are from postgres driver or server. So when you do psql -U asteriskcdruser -d asteriskcdrdb That does connect you are connecting to a different database, dont you need to change the odbc.ini to have Database=asteriskcdrdb instead of the Database=dbname That you have shown to be in the ini file. > [pgdb-cdr] > ;Driver = /usr/pgsql-9.4/lib/psqlodbc.so > Driver=PostgreSQL > ServerName=localhost > Port=5432 > UserName=dbuser > Password=dbpassword > Database=dbname > ReadOnly=No > Protocol=9.4 > Trace=Yes > TraceFile=/tmp/sql.log > ConnSettings= > DSN=pgdb > ServerType=Postgres > Debug=1 > DebugFile=/var/log/postgresql_debug.log > -- Nick -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc