Re: Just some unfinished stuff.

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

Re: Just some unfinished stuff.

От:
Gerald Gryschuk <gerald.gryschuk@home.com>
Дата:
Thomas G. Lockhart wrote:
> Anyway, is there any reason why you changed the behavior of configure to
> always prompt for the platform type? I've got patches which restore the
> Postgres configure behavior, which does not stop to prompt if it thinks
> it has a match.

Hmm... Forgive me a second. Are we talking when ./configure is done from
the top level Postgres directory(i.e. an integrated build) or are you
referring to a standalone build? Also I'm not sure what you mean by the
default Postgres behaviour. Remember I'm working from using the 6.3
source distribution. In the version I have Postgres, without any odbc
driver stuff, stops to prompt for my platform. If it doesn't stop in
the 6.4 version I don't think any of my changes should make it stop.

Maybe I should explain what I attempted and you can tell me if it
matches
what you see.

1) The 6.3 Postgres distribution configuration without our odbc stuff
stops to prompt for my platform, at least this is what I observed.
2) A STANDALONE odbc driver configuration stops to prompt for my
platform, this is because I started by copying the 6.3 configuration
files and edited to suit my needs.
3) My first run at integrating the two meant that the configuration
for an INTEGRATED build stopped twice.
4) After finding out that the TEMPLATE variable in the Postgres
configuration gets exported to the environment I made changes to
the odbc driver configuation such that if it was being built in
an integrated configuration that it's ./configure script would
NOT stop since it was able to get the TEMPLATE variable from the
environment.
5) After the changes in 4) a standalone build of the odbc driver
should still behave the same, i.e. it should stop and prompt for the 
platform type.

If your saying that my observation in 1) is "wrong" than I don't
know what's up with that. If the original Postgres distribution,
without our integrated odbc source, isn't supposed to stop than
I don't think that any of my suggested changes to the Postgres
configure.in would have made it stop. On the other hand, your
working with the 6.4 configuation scripts, so... if the
6.4 configuration script doesn't stop AND it DOESN"T export
the TEMPLATE variable(condition 4 above) to the environment, than 
attempting to build an integrated source with the odbc driver
WILL make it stop since the odbc configure script won't know
what the "current" value of TEMPLATE is. This would suggest to
me that there are "significant" changes to the 6.4 configure
script which I didn't have. Thus if you have fixes that can
easily be made to the odbc driver configure.in than by all
means make them.

NOTE: When I started this I always found it weird that the
6.3 configure script would stop and prompt. I had never seen
this before given that configure has access to exactly which
platform your running on through the AC_CONFIG_HOST(?) macro.
I was trying to make changes to avoid this behaviour but
I'm not good enough at this configure stuff yet to have
done it.

Sorry for the long winded explanation to what I'm sure seemed
like a straight forward question.

> Byron, apparently you and Gerald have already settled the WINDOWS vs.
> WIN32 problem? Do I have access to the latest source code? I hate asking
> you to do the ./configure integration if you don't have a way to test it
> (I'm not sure what your platform mix is, but assume that it has at least
> one windows machine :).

Don't worry I don't have Byron's changes either. Recall that I asked
Byron to check into this when I sent out my first configure attempt.
He reponsed(quite quickly I might add) that he had to change my
use of WINDOWS to WIN32 but that was it. I wasn't all that worried
figuring I'ld just pick up the new source in the next release but
I guess you should probably get it earlier than that.

> 
> Gerald, do we have some ideas on who will take on the
> configure.in/template maintenance as we integrate more platforms (hint,
> hint)? I've got so many commitments to various pieces of Postgres
> already that I'd really like to avoid becoming the bottleneck for this
> support...

I have limited access to some SUN equipment for testing builds,
but I don't really like using it for this kind of thing since the
sys admin where the equipement is, is essentially doing me a favor
by keeping my (very) old account active. We have a Digital Alpha
dual boot system at work that I set up, so I can also do test builds
there under OSF/1 time permitted. Sooo.. I can't promise that I'll 
put as much hard time in as I did on the configure and the original 
port which both cut into my real job. But I'll stand as the Unix
"maintainer" if you like.

> Speaking of docs, Byron, do you have a preference for how we will do
> nice docs for the distribution? I've got some sgml source code for
> Unix-side issues, but have not integrated any other information. Could
> you summarize what docs resources currently exist, and which ones you
> would like to see in the future?

Oh goody. Real docs. I was hoping someone else would do them. Can I
assume that if your writing "nice docs" that I don't have to write
that new Readme I mentioned?

> 
> A nice chapter on the odbc stuff in the main Postgres docs could also be
> built as a standalone document, which would give you both hardcopy and
> html for your distribution...

Just as a matter of completeness if your putting "maintainers" e-mail
addresses in the docs you might want to put in both of mine, at
work it's ggryschuk@scf.sk.ca and at home it's gerald.gryschuk@home.com.
Some day I'll set up my Linux accounts so my e-mail gets automatically
forwarded depending on the time of day but it doesn't seem quite that
important right now.

> 
> btw, it might be nice to keep the discussion on the interfaces mailing
> list so others can offer help and keep up to date with progress.

Done, I've CC'ed this response to the mailing list.

-- 
Gerald Gryschuk
gerald.gryschuk@home.com
MidNightOil Consulting - "We burn the midnight oil so you don't have
to."

Re: Just some unfinished stuff.

От:
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Дата:
Tim Goeke Thomas Lockhart 1998-08-25 Background information originally by Tim Goeke ODBC (Open Database Connectivity) is an abstract API which allows you to write standard "ODBC" applications. ODBC provides a product-neutral interface between frontend applications and database servers, allowing a user or developer to write applications which are portable among servers. The ODBC API matches up on the backend to an ODBC-compatible data source. This could be anything from a text file to an Oracle or Postgres RDBMS. The backend access come from ODBC drivers, or vendor specifc drivers that allow data access. psqlODBC is such a driver, along with others that are available, such as the OpenLink ODBC drivers. Once you write an ODBC application, you SHOULD be able to connect to ANY back end database, regardless of the vendor, as long as the database schema is the same. For example. you could have MS SQL Server and Postgres servers which have exactly the same data. Using ODBC, your Windows app would make exactly the same calls and the back end data source would look the same (to the windows app). Insight Distributors provides active and ongoing support for the core psqlODBC distribution. They provide a FAQ, ongoing development on the code base, and actively participate on the interfaces mailing list. In the real world, differences in drivers and the level of ODBC support lessens the potential of ODBC: Access, Delphi, and Visual Basic all support ODBC directly. Under C++, such as Visual C++, you can use the C++ ODBC API. In Visual C++, you can use the CRecordSet class, which wraps the ODBC API set within an MFC 4.2 class. This is the easiest route if you are doing Windows C++ development under Windows NT. If I write an app for Postgres can I write it using ODBC calls to the Postgres server, or is that only when another database program like MS SQL Server or Access needs to access the data? Again, the ODBC API set is the way to go. You can find out more at Microsoft's web site or in your Visual C++ docs (if that's what you are using.) Visual Basic and the other RAD tools have Recordset objects that use ODBC directly to access data. Using the data-aware controls, you can quickly link to the ODBC back end database (very quickly). Playing around with MS Access will help you sort this out. Try using File->Get External Data You'll have to set up a DSN first. ApplixWare has an ODBC database interface supported on at least some platforms. ApplixWare v4.4.1 has been demonstrated under Linux with Postgres v6.4 using the psqlODBC driver contained in the Postgres distribution. The ~/.odbc.ini contains user-specified access information for the psqlODBC driver. The file uses conventions typical for Windows Registry files, but despite this restriction can be made to work. Here is an example .odbc.ini file, showing access information for three databases: [ODBC Data Sources] DataEntry = Read/Write Database QueryOnly = Read-only Database Test = Debugging Database Default = Postgres Stripped [DataEntry] ReadOnly = 0 Servername = localhost Database = Sales [QueryOnly] ReadOnly = 1 Servername = localhost Database = Sales [Test] Debug = 1 CommLog = 1 ReadOnly = 0 Servername = localhost Username = tgl Password = "no$way" Port = 5432 Database = test [Default] Servername = localhost Database = tgl Driver = /opt/postgres/current/lib/libpsqlodbc.so [ODBC] InstallDir = /opt/applix/axdata/axshlib For Applix, here is an example ~/axhome/macros/login.am file: macro login set_set_system_var@("sql_username@","tgl") set_system_var@("sql_passwd@","no$way") endmacro psqlODBC has been built and tested on Linux. There have been reports of success with FreeBSD and with Solaris.
PostgreSQL Programmer's Guide
PrevNext

Chapter 19. ODBC Interface

Note: Background information originally by Tim Goeke

ODBC (Open Database Connectivity) is an abstract API which allows you to write standard "ODBC" applications. ODBC provides a product-neutral interface between frontend applications and database servers, allowing a user or developer to write applications which are portable among servers.

Background

The ODBC API matches up on the backend to an ODBC-compatible data source. This could be anything from a text file to an Oracle or Postgres RDBMS.

The backend access come from ODBC drivers, or vendor specifc drivers that allow data access. psqlODBC is such a driver, along with others that are available, such as the OpenLink ODBC drivers.

Once you write an ODBC application, you SHOULD be able to connect to ANY back end database, regardless of the vendor, as long as the database schema is the same.

For example. you could have MS SQL Server and Postgres servers which have exactly the same data. Using ODBC, your Windows app would make exactly the same calls and the back end data source would look the same (to the windows app).

Insight Distributors provides active and ongoing support for the core psqlODBC distribution. They provide a FAQ, ongoing development on the code base, and actively participate on the interfaces mailing list.


PrevHomeNext
pg_lo_export Windows Applications
PostgreSQL Programmer's Guide
PrevChapter 19. ODBC InterfaceNext

Windows Applications

In the real world, differences in drivers and the level of ODBC support lessens the potential of ODBC:

Access, Delphi, and Visual Basic all support ODBC directly.
Under C++, such as Visual C++, you can use the C++ ODBC API.
In Visual C++, you can use the CRecordSet class, which wraps the ODBC API set within an MFC 4.2 class. This is the easiest route if you are doing Windows C++ development under Windows NT.

If I write an app for Postgres can I write it using ODBC calls to the Postgres server, or is that only when another database program like MS SQL Server or Access needs to access the data?

Again, the ODBC API set is the way to go. You can find out more at Microsoft's web site or in your Visual C++ docs (if that's what you are using.)

Visual Basic and the other RAD tools have Recordset objects that use ODBC directly to access data. Using the data-aware controls, you can quickly link to the ODBC back end database (very quickly).

Playing around with MS Access will help you sort this out. Try using File->Get External Data

Tip: You'll have to set up a DSN first.


PrevHomeNext
ODBC InterfaceUpUnix Applications
PostgreSQL Programmer's Guide
PrevChapter 19. ODBC InterfaceNext

Unix Applications

ApplixWare has an ODBC database interface supported on at least some platforms. ApplixWare v4.4.1 has been demonstrated under Linux with Postgres v6.4 using the psqlODBC driver contained in the Postgres distribution.

Configuration Files

The ~/.odbc.ini contains user-specified access information for the psqlODBC driver. The file uses conventions typical for Windows Registry files, but despite this restriction can be made to work.

Here is an example .odbc.ini file, showing access information for three databases:

[ODBC Data Sources]
DataEntry = Read/Write Database
QueryOnly = Read-only Database
Test = Debugging Database
Default = Postgres Stripped

[DataEntry]
ReadOnly = 0
Servername = localhost
Database = Sales

[QueryOnly]
ReadOnly = 1
Servername = localhost
Database = Sales

[Test]
Debug = 1
CommLog = 1
ReadOnly = 0
Servername = localhost
Username = tgl
Password = "no$way"
Port = 5432
Database = test

[Default]
Servername = localhost
Database = tgl
Driver = /opt/postgres/current/lib/libpsqlodbc.so

[ODBC]
InstallDir = /opt/applix/axdata/axshlib

For Applix, here is an example ~/axhome/macros/login.am file:

macro login       set_set_system_var@("sql_username@","tgl")       set_system_var@("sql_passwd@","no$way")
endmacro

PrevHomeNext
Windows ApplicationsUpSupported Platforms
PostgreSQL Programmer's Guide
PrevChapter 19. ODBC InterfaceNext

Supported Platforms

psqlODBC has been built and tested on Linux. There have been reports of success with FreeBSD and with Solaris.


PrevHomeNext
Unix ApplicationsUpJDBC Interface
FAQ