Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHAbA-00060I-K9 for pgsql-odbc@arkaria.postgresql.org; Mon, 20 Jul 2015 12:55:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHAbA-00072X-4a for pgsql-odbc@arkaria.postgresql.org; Mon, 20 Jul 2015 12:55:12 +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 1ZHAam-00069A-P8 for pgsql-odbc@postgresql.org; Mon, 20 Jul 2015 12:54:48 +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 1ZHAai-0005OG-2x for pgsql-odbc@postgresql.org; Mon, 20 Jul 2015 12:54:46 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 9659F422356 for ; Mon, 20 Jul 2015 14:54:37 +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 0J1U7iM5QJWb; Mon, 20 Jul 2015 14:54:36 +0200 (SAST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 26EE3422357; Mon, 20 Jul 2015 14:54:36 +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 BVsY4e9U31v8; Mon, 20 Jul 2015 14:54:36 +0200 (SAST) Received: from STEFANPC (unknown [172.16.1.76]) by mail.verishare.co.za (Postfix) with ESMTPSA id 11D77422356 for ; Mon, 20 Jul 2015 14:54:36 +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> <55BAADA01D8C504993894EAEA7517CF8124630@003FCH1MPN2-002.003f.mgd2.msft.net> <000d01d0c2b8$a8f146e0$fad3d4a0$@verishare.co.za>, <004501d0c2d8$5a4cc710$0ee65530$@verishare.co.za> <55BAADA01D8C504993894EAEA7517CF81246C6@003FCH1MPN2-002.003f.mgd2.msft.net>, <004601d0c2db$2d38ade0$87aa09a0$@verishare.co.za> <55BAADA01D8C504993894EAEA7517CF81246DB@003FCH1MPN2-002.003f.mgd2.msft.net> <004a01d0c2e4$ad416320$07c42960$@verishare.co.za> <55ACE4C5.2030704@lurcher.org> In-Reply-To: <55ACE4C5.2030704@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 14:57:48 +0200 Message-ID: <005101d0c2eb$ae674150$0b35c3f0$@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+uLVACvS0eZwIDK6DSAbi5yQACNRVlIgKyOovEAwQzP6cC5YclzgJpmRobAc/BjzoBf0NcHwGnPLYpAkwTS5MBk03d/wG9jGHvAr6SG74B/EZIOZwMfXaA 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 >Can I just check, when you say "unixODBC drivers" you don't mean the age old version of the postgres driver that used to be part of the default unixODBC build? If it is, don't touch that, its only there as a example. Unsure. Here's what I did to install unixODBC and postgres 9.4 - I installed unixODBC via yum on Centos 6.5 and updated it via yum - I edited /etc/yum.repos.d/CentOSBase.repo and in the [base] section added exlucde=postgresql* - I edited /etc/yum.repos.d/CentOSBase.repo and in the [updates] section added exlucde=postgresql* - I added a file pdgd-94-centos.repo which contains: --- [pgdg94] name=PostgreSQL 9.4 $releasever - $basearch baseurl=http://yum.postgresql.org/9.4/redhat/rhel-$releasever-$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-94 [pgdg94-source] name=PostgreSQL 9.4 $releasever - $basearch - Source failovermethod=priority baseurl=http://yum.postgresql.org/srpms/9.4/redhat/rhel-$releasever-$basearc h enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-94 --- - Afer doing that I installed the following postgres packages from the postgres repo added above: --- postgresql94.x86_64 9.4.4-1PGDG.rhel6 postgresql94-contrib.x86_64 postgresql94-devel.x86_64 postgresql94-docs.x86_64 postgresql94-libs.x86_64 postgresql94-odbc.x86_64 postgresql94-odbc-debuginfo.x86_64 postgresql94-server.x86_64 --- - I then configured pg_hba.conf and started the postgress instance via service postgresql-9.4 start chkconfig postgresql-9.4 on - I set up odbc.ini as detailed before: --- [pgdb-cdr] Driver = /usr/pgsql-9.4/lib/psqlodbc.so ;Driver=PostgreSQL ServerName=/tmp Port=5432 UserName=asteriskcdruser Password=1ndestruc# 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 --- in which I explicitly select the driver in the above location, not another driver somewhere else? isql fails to connect to postgres with --- isql -v pgdb-cdr dbuser dbpass [S1000][unixODBC]The database does not exist on the server or user authentication failed. [ISQL]ERROR: Could not SQLConnect [root@jhbasterisk yum.repos.d]# --- while psql itself works fine: --- #psql -h 127.0.0.1 -U asteriskcdruser -d asteriskcdrdb psql (9.4.4) Type "help" for help. 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=> --- Does this nonetheless mean I'm using the incorrect driver and that is what is causing the unixODBC utlity isql to no be able to connect to postgres? Thanks Kind regards Stefan -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc