Обсуждение: odbc with debian woody/postgres

Поиск
Список
Период
Сортировка

odbc with debian woody/postgres

От
Matt Price
Дата:
Hi there,

I'm trying to get odbc to work on my machine.  Here's the setup:
Debian Woody with Postgresql 7.2; unixodbc and odbc-postgresql also
installed.  I followed the directionsi n the 'Debian HOWTO' that comes
with the odbc-postgresql package, so my odbcinit.ini looks like this:

[PostgreSQL]
Description             = PostgreSQL ODBC driver for Linux and Windows
Driver          = /usr/lib/postgresql/lib/libodbcpsql.so
Setup           = /usr/lib/odbc/libodbcpsqlS.so
Debug           = 0
CommLog         = 1
FileUsage               = 1


My odbc.ini currently looks like this (slightly modified from the
original):


[PostgreSQL]
Description         = PostgreSQL template1
Driver              = PostgreSQL
Trace               = No
TraceFile           = /tmp/odbc.log
Database            = template1
Servername          = localhost
UserName            = postgres
Password            = postgres
Port                = 5432
Protocol            = 6.4
ReadOnly            = Yes
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =


and the relevant lines of pg_hba.conf are the following:
local        all                                           trust
host         all         127.0.0.1     255.0.0.0           ident
sameuser
host         all         0.0.0.0       0.0.0.0             reject


With this setup I can't seem to get odbc towork.  I should note that
psql works fine, and that odbc works fine with mysql (I've left the
mysql bits of the odbc*.ini files out) -- in fact, it worked right out
of the box, which was kind of amazing given how hard a time I'm having
with postgresql).  using isql I get the following error:
-------------------
isql Postgresql -v
[unixODBC]FATAL 1:  IDENT authentication failed for user "postgres"

[ISQL]ERROR: Could not SQLConnect
-----------------
I'm doing all this directly from the shell, so I don't understand why
Postgres is using the 'ident' verification method.  Can anyone give me
any pointers?  Again, I've had no problem iwth psql or the mysql/odbc
combination, so I assume something is wrongwith my setup for
postgres.  Thanks,
Matt

ps:  assuming I get thisworking, how do I add other database names to
odbc.ini?  Do I need whole new sections (like
"[Postgresql/dbname]") or can I just add the dbnames to the Database
line of the file?

Re: odbc with debian woody/postgres

От
Michael Meskes
Дата:
On Wed, Oct 09, 2002 at 02:22:38AM -0400, Matt Price wrote:
> local        all                                           trust
> host         all         127.0.0.1     255.0.0.0           ident

Here you tell PostgreSQL to use ident.

> ps:  assuming I get thisworking, how do I add other database names to
> odbc.ini?  Do I need whole new sections (like
> "[Postgresql/dbname]") or can I just add the dbnames to the Database
> line of the file?

Sorry I don't fully understand that. You define one ODBC conenction for
exactly one database, so what are you looking for?

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Re: odbc with debian woody/postgres

От
Matt Price
Дата:
Thanks Christoph, I'm going to try this.  But I'm having a little
trouble figuring out how to get postmaster to start up at boot time
with the -i option.  This is a debian-specific problem -- I don't
really understand the script in /etc/init.d and I can't figure out
which line therein I need to modify in order to get it to start up
with TCP/IP listening.  I don't see an obvious call to postmaster...
anyone familiar with this script know what I should do?  thanks
m


On Wed, Oct 09, 2002 at 10:28:47AM +0200, Christoph Dalitz wrote:
> On Wed, 09 Oct 2002 02:27:10 -0400
> pgsql-general-owner@postgresql.org wrote:
>
> > Date: Wed, 9 Oct 2002 02:22:38 -0400
> > From: Matt Price <matt.price@utoronto.ca>
> > To: debian users <debian-user@lists.debian.org>,
> >     pgsql-general@postgresql.org
> > Subject: odbc with debian woody/postgres
> > Message-ID: <20021009062238.GA1733@utoronto.ca>
> >
> >
> > My odbc.ini currently looks like this (slightly modified from the
> > original):
> >
> >
> > [PostgreSQL]
> > Description         = PostgreSQL template1
> > Driver              = PostgreSQL
> > Trace               = No
> > TraceFile           = /tmp/odbc.log
> > Database            = template1
> > Servername          = localhost
> >
> If you only want a local connection via Unix Domain Sockets to your database, you
> should leave "Servername" empty. Otherwise you will need to run postmaster with the
> "-i" option so that it listens on TCP/IP connections.
>
> Without "Servername", the following pg_hba.conf entry should be sufficient:
>
> > local        all                                           trust
> >
> Becuse of "trust", you can omit the Password in odbc.ini.
>
> BTW you should consider creating a second database and a database user for
> your application; working always as superuser might not be what you want.
>
> Hope this helps,
>
> Christoph Dalitz

Re: odbc with debian woody/postgres

От
Herbie Liechti
Дата:
Am Mittwoch, 9. Oktober 2002 18.07 schrieben Sie:
> Thanks Christoph, I'm going to try this.  But I'm having a little
> trouble figuring out how to get postmaster to start up at boot time
> with the -i option.  This is a debian-specific problem -- I don't
> really understand the script in /etc/init.d and I can't figure out
> which line therein I need to modify in order to get it to start up
> with TCP/IP listening.  I don't see an obvious call to postmaster...
> anyone familiar with this script know what I should do?

You have to change the file postgresql.conf in /etc/postgresql
There is configuration entry for starting tcp/ip listening:

# TCP/IP access is allowed by default, but the default access given in
# pg_hba.conf will permit it only from localhost, not other machines.
tcpip_socket = 1

Be sure that your pga_hba.conf is set up correctly.

Best regards
Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti                                  http://www.thinx.ch
The content management company.         Visit http://www.contentx.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


High-end PGSQL / Business Intelligence

От
"Markus Gieppner"
Дата:
For those of you who are trying to promote PostGreSQL or simply to
demonstrate PG's potential capabilities, you might look at this article in
Network Fusion about Netezza: They announced their "NPS 8000" database
appliance that runs on Linux and is built on PostGreSQL. According to the
article, they achieve 300%-1000% performance increases in BI applications
compared to traditional (eeeh... Oracle-Sun-EMC ) systems for half of the
price.

http://www.nwfusion.com/news/2002/1007infranetezza.html
http://www.netezza.com/index.html

If this has already been mentioned here please disregard.

Markus

Disclaimer: I am NOT affiliated with Netezza, nor PostGreSQL, nor Oracle,
Network Fusion nor ...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002


Re: odbc with debian woody/postgres

От
Matt Price
Дата:
danke herbie.  kleine frage:

what should the variable "tcpip_socket" be set to to allow tcp/ip
connections?
m

> # TCP/IP access is allowed by default, but the default access given in
> # pg_hba.conf will permit it only from localhost, not other machines.
> tcpip_socket = 1
>
> Be sure that your pga_hba.conf is set up correctly.
>
> Best regards
> Herbie
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Herbert Liechti                                  http://www.thinx.ch
> The content management company.         Visit http://www.contentx.ch
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: odbc with debian woody/postgres

От
Herbie Liechti
Дата:
Am Mittwoch, 9. Oktober 2002 18.07 schrieben Sie:

>what should the variable "tcpip_socket" be set to to allow tcp/ip
>connections?

tcpip_socket = 1

It's working for me without any problems. We have the application server and
database server on seperate machines.

Best Regards Herbie

>> Be sure that your pga_hba.conf is set up correctly.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti                                  http://www.thinx.ch
The content management company.         Visit http://www.contentx.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~