Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZH4fr-0001Mm-Jw for pgsql-odbc@arkaria.postgresql.org; Mon, 20 Jul 2015 06:35:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZH4fq-00029H-Fo for pgsql-odbc@arkaria.postgresql.org; Mon, 20 Jul 2015 06:35:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZH4fo-00028h-OB for pgsql-odbc@postgresql.org; Mon, 20 Jul 2015 06:35:36 +0000 Received: from mail.verishare.co.za ([217.29.208.2]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZH4Xx-0006G0-2h for pgsql-odbc@postgresql.org; Mon, 20 Jul 2015 06:27:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 955AF421782 for ; Mon, 20 Jul 2015 08:27:17 +0200 (SAST) Received: from mail.verishare.co.za ([127.0.0.1]) by localhost (mail.verishare.co.za [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id G3KIBKPYmn7Z; Mon, 20 Jul 2015 08:27:16 +0200 (SAST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 6143C422340; Mon, 20 Jul 2015 08:27:16 +0200 (SAST) X-Virus-Scanned: amavisd-new at verishare.co.za Received: from mail.verishare.co.za ([127.0.0.1]) by localhost (mail.verishare.co.za [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hK30xdpFtCJT; Mon, 20 Jul 2015 08:27:16 +0200 (SAST) Received: from STEFANPC (unknown [172.16.1.76]) by mail.verishare.co.za (Postfix) with ESMTPSA id 253C4421782 for ; Mon, 20 Jul 2015 08:27:16 +0200 (SAST) From: "Stefan Viljoen" To: 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> <55A917AB.3010802@lurcher.org> In-Reply-To: <55A917AB.3010802@lurcher.org> Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client Date: Mon, 20 Jul 2015 08:30:27 +0200 Message-ID: <000c01d0c2b5$91b064f0$b5112ed0$@verishare.co.za> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIlJsTM6eABCGiGgETx/eeRTV0aKQD+sBlEAd+uLVACvS0eZwIDK6DSAbi5yQACNRVlIgKyOovEAwQzP6cC5YclzgJpmRobAUliG92cfD7foA== Content-Language: en-za X-Pg-Spam-Score: -3.1 (---) 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 Hi Nick >Its getting past the driver manager to the driver in all cases, those errors are from postgres driver or server. Ok >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 Ok I changed by odbc.ini to read --- [pgdb-cdr] ;Driver = /usr/pgsql-9.4/lib/psqlodbc.so Driver=PostgreSQL ServerName=localhost Port=5432 UserName=username Password=pword Database=asteriskcdrdb ReadOnly=No Protocol=9.4 Trace=Yes TraceFile=/tmp/sql.log ConnSettings= DSN=pgdb ServerType=Postgres Debug=1 DebugFile=/var/log/postgresql_debug.log --- PostgreSQL is defined in my odbcinst.conf The response still remains --- [root@jhbasterisk pg_log]# isql -v pgdb-cdr username pword [S1000][unixODBC]The database does not exist on the server or user authentication failed. [ISQL]ERROR: Could not SQLConnect [root@jhbasterisk pg_log]# --- If i check using psql: --- [root@jhbasterisk pg_log]# psql -U username -d asteriskcdrdb psql (9.4.4) Type "help" for help. asteriskcdrdb=> \d+ List of relations Schema | Name | Type | Owner | Size | Description --------+----------------+----------+-----------------+------------+-------- ----- public | cdr | table | asteriskcdruser | 8192 bytes | public | cdr_id_seq | sequence | asteriskcdruser | 8192 bytes | public | cdr_leg | table | asteriskcdruser | 8192 bytes | public | cdr_leg_id_seq | sequence | asteriskcdruser | 8192 bytes | public | cel | table | asteriskcdruser | 8192 bytes | public | cel_id_seq | sequence | asteriskcdruser | 8192 bytes | (6 rows) asteriskcdrdb=> \list List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---------------+----------+----------+-------------+-------------+---------- -------------------- asteriskcdrdb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres + | | | | | postgres=CTc/postgres + | | | | | asteriskcdruser=CTc/postgres postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (4 rows) asteriskcdrdb=> --- Tables cdr_leg, cdr and cel are in asteriskcdrdb. Thanks for your continued assistance! Kind regards, -- Nick -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc