Generic ODBC and column alias questions (fwd) - Mailing list pgsql-general
From | Font |
---|---|
Subject | Generic ODBC and column alias questions (fwd) |
Date | |
Msg-id | Pine.BSF.3.96.991027141541.19992A-100000@couscous.fortdearborn.com Whole thread Raw |
List | pgsql-general |
Is there a more appropriate mailing list for this topic? Thanks, font@couscous.fortdearborn.com ---------- Forwarded message ---------- Date: Fri, 22 Oct 1999 17:12:20 -0500 (CDT) From: Font <font@couscous.fortdearborn.com> To: pgsql-general@postgresql.org Cc: font@couscous.fortdearborn.com Subject: Generic ODBC and column alias questions I'm a new subscriber to the list -- if anything here is answered in a FAQ, please feel free to indicate where I should RTFM. Firstly, I want make my first PostgreSQL installation ODBC-accessible, so that the application accessing it is not bound to a particular database implementation. Right now I'm playing with PHP3 on a Solaris 2.7 box. I built pgsql 6.5.2 configuring with the --with-odbc flag. I then built PHP3.0.12 with --with-iodbc --with-apache=... and --with-pgsql. I also built iODBC 2.50.3. All of these builds went pretty well and installed without incident. Everything is on the same box right now, web server, PHP, and PostgreSQL. PostgreSQL is accessible from PHP3 using the PostgreSQL-native database access functions, but isn't accessible using the ODBC database access functions. I'm wondering if there is some kind of syncing-up that needs to happen between the iODBC odbc.ini (or ~/.odbc.ini) and PostgreSQL's odbcinst.ini. The odbcinst.ini is the installation default, while the odbc.ini is set up for the two databases I have: ; ; odbc.ini ; [ODBC Data Sources] template1 = sample database timemat = Time and Materials [timemat] Servername = localhost Port = 5432 Database = timemat [template1] Driver = /usr/local/pgsql/lib/libpsqlodbc.so Description = PostgreSQL Template1 Database Servername = localhost Username = Password = Database = template1 Protocol = 6.4 Options = ReadOnly = no Debug = 0 Comm = 1 [Default] Driver = /usr/local/pgsql/lib/libpsqlodbc.so Does anything here look off? When I try to connect to "timemat", I get the error "Warning: SQL error: Requested value changed., SQL state 01S02 in SQLExecDirect in [scriptname and line]". This is different from when I don't have the ~/.odbc.ini and have the same information in /usr/local/etc/odbc.ini, in which case the error becomes "Warning: SQL error: Missing server name, port, or database name in call to CC_connect., SQL state IM002 in SQLConnect in [sriptname and line]". This even though I have provided the server name, port, and database name. This is probably equally a PHP3 question as a PostgreSQL question, but I thought I would start here. Thanks for any help you can give! The second question is quick, and is this: Can a column in a table be given an alias, so that it could be referred to be either name? I have an int4 which I'd like to refer to as either "id" or "usr_id". My experience with PostgreSQL so far is that it's pretty neat! Thanks, dw font@couscous.fortdearborn.com
pgsql-general by date: