Searching for database libraries

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Searching for database libraries

Mark Morgan Lloyd-5
When using something like InitialisePostgres3(), if the approximate
location of the database library (.so or .dll) is known, what's the most
effective way of finding the exact file? Is there a single routine that
does a recursive search?

The reason that I ask is that it appears that the most efficient way of
getting libpq.dll for Windows is to install the ODBC drivers, and they
go into a directory typically named like C:\Program
Files\psql\ODBC\xxxx\bin where xxxx is a version number.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Michael Van Canneyt


On Fri, 7 Dec 2012, Mark Morgan Lloyd wrote:

> When using something like InitialisePostgres3(), if the approximate location
> of the database library (.so or .dll) is known, what's the most effective way
> of finding the exact file? Is there a single routine that does a recursive
> search?

No.

> The reason that I ask is that it appears that the most efficient way of
> getting libpq.dll for Windows is to install the ODBC drivers, and they go
> into a directory typically named like C:\Program Files\psql\ODBC\xxxx\bin
> where xxxx is a version number.

Maybe the installer writes something in the registry, in which case you could try that first.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Mark Morgan Lloyd-5
Michael Van Canneyt wrote:

> On Fri, 7 Dec 2012, Mark Morgan Lloyd wrote:
>
>> When using something like InitialisePostgres3(), if the approximate
>> location of the database library (.so or .dll) is known, what's the
>> most effective way of finding the exact file? Is there a single
>> routine that does a recursive search?
>
> No.
>
>> The reason that I ask is that it appears that the most efficient way
>> of getting libpq.dll for Windows is to install the ODBC drivers, and
>> they go into a directory typically named like C:\Program
>> Files\psql\ODBC\xxxx\bin where xxxx is a version number.
>
> Maybe the installer writes something in the registry, in which case you
> could try that first.

There's a problem with this on (at least some versions of) Windows: if
you use InitialisePostgres3() it will find libpq.dll but not other
libraries such as ssleay. A workable hack appears to be to cd to the
directory that contains the DLLs before attempting to establish the
database connection.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Michael Van Canneyt


On Sat, 8 Dec 2012, Mark Morgan Lloyd wrote:

> Michael Van Canneyt wrote:
>> On Fri, 7 Dec 2012, Mark Morgan Lloyd wrote:
>>
>>> When using something like InitialisePostgres3(), if the approximate
>>> location of the database library (.so or .dll) is known, what's the most
>>> effective way of finding the exact file? Is there a single routine that
>>> does a recursive search?
>>
>> No.
>>
>>> The reason that I ask is that it appears that the most efficient way of
>>> getting libpq.dll for Windows is to install the ODBC drivers, and they go
>>> into a directory typically named like C:\Program Files\psql\ODBC\xxxx\bin
>>> where xxxx is a version number.
>>
>> Maybe the installer writes something in the registry, in which case you
>> could try that first.
>
> There's a problem with this on (at least some versions of) Windows: if you
> use InitialisePostgres3() it will find libpq.dll but not other libraries such
> as ssleay. A workable hack appears to be to cd to the directory that contains
> the DLLs before attempting to establish the database connection.

I consider this an installation problem, not something that must be catered for in FPC.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Marco van de Voort
In our previous episode, Michael Van Canneyt said:
> >> Maybe the installer writes something in the registry, in which case you
> >> could try that first.
> >
> > There's a problem with this on (at least some versions of) Windows: if you
> > use InitialisePostgres3() it will find libpq.dll but not other libraries such
> > as ssleay. A workable hack appears to be to cd to the directory that contains
> > the DLLs before attempting to establish the database connection.
>
> I consider this an installation problem, not something that must be catered for in FPC.

That's what I thought too. They are installed in a way that they are only
easily usable via odbc.

Anyway, a workaround could be to try to add the filedir of the dll found via
the registry to the path. (on shell level, not FPC rtl level)
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Mark Morgan Lloyd-5
In reply to this post by Michael Van Canneyt
Michael Van Canneyt wrote:

>>>> The reason that I ask is that it appears that the most efficient way
>>>> of getting libpq.dll for Windows is to install the ODBC drivers, and
>>>> they go into a directory typically named like C:\Program
>>>> Files\psql\ODBC\xxxx\bin where xxxx is a version number.
>>>
>>> Maybe the installer writes something in the registry, in which case
>>> you could try that first.
>>
>> There's a problem with this on (at least some versions of) Windows: if
>> you use InitialisePostgres3() it will find libpq.dll but not other
>> libraries such as ssleay. A workable hack appears to be to cd to the
>> directory that contains the DLLs before attempting to establish the
>> database connection.
>
> I consider this an installation problem, not something that must be
> catered for in FPC.

I'm inclined to agree with you. However I think it's noteworthy that
passing a library name to InitialisePostgres3() is an incomplete
solution since (a) at least on Windows it can't provide a path to
libpq's prerequisites and (b) if built to be able to use SSL then libpq
requires that it be available, even if it isn't being used for the
session being established.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Mark Morgan Lloyd-5
In reply to this post by Marco van de Voort
Marco van de Voort wrote:

> In our previous episode, Michael Van Canneyt said:
>>>> Maybe the installer writes something in the registry, in which case you
>>>> could try that first.
>>> There's a problem with this on (at least some versions of) Windows: if you
>>> use InitialisePostgres3() it will find libpq.dll but not other libraries such
>>> as ssleay. A workable hack appears to be to cd to the directory that contains
>>> the DLLs before attempting to establish the database connection.
>> I consider this an installation problem, not something that must be catered for in FPC.
>
> That's what I thought too. They are installed in a way that they are only
> easily usable via odbc.
>
> Anyway, a workaround could be to try to add the filedir of the dll found via
> the registry to the path. (on shell level, not FPC rtl level)

Does Windows use the standard path for searching DLLs? I can confirm
that inside a program temporarily changing the current directory has the
desired effect, and this can obviously be done with reference to the
registry.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Michael Van Canneyt


On Sun, 9 Dec 2012, Mark Morgan Lloyd wrote:

> Marco van de Voort wrote:
>> In our previous episode, Michael Van Canneyt said:
>>>>> Maybe the installer writes something in the registry, in which case you
>>>>> could try that first.
>>>> There's a problem with this on (at least some versions of) Windows: if
>>>> you use InitialisePostgres3() it will find libpq.dll but not other
>>>> libraries such as ssleay. A workable hack appears to be to cd to the
>>>> directory that contains the DLLs before attempting to establish the
>>>> database connection.
>>> I consider this an installation problem, not something that must be
>>> catered for in FPC.
>>
>> That's what I thought too. They are installed in a way that they are only
>> easily usable via odbc.
>>
>> Anyway, a workaround could be to try to add the filedir of the dll found
>> via
>> the registry to the path. (on shell level, not FPC rtl level)
>
> Does Windows use the standard path for searching DLLs?

Yes, after the current working directory, and possibly the location of the binary itself.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

Reinier Olislagers
In reply to this post by Mark Morgan Lloyd-5
On 9-12-2012 14:05, Mark Morgan Lloyd wrote:
> Does Windows use the standard path for searching DLLs? I can confirm
> that inside a program temporarily changing the current directory has the
> desired effect, and this can obviously be done with reference to the
> registry.

For the authorative answer, see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#search_order_for_desktop_applications

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

anatolamike
This post has NOT been accepted by the mailing list yet.
The Database Library is the UW-Madison Libraries collection of databases. You can find databases either By Subject or By Title. Some databases can be searched simultaneously by checking/unchecking database check boxes and then using the search box on a subject page; other databases must be searched individually by clicking on the database title.

Search results can be temporarily saved and then emailed or exported. Subject pages or sections of same can be created as a widget and put into your own webpage. Most subject pages have a Highlighted Resource that can provide information about a particularly useful or new database.




DJs Chicago

dj services Chicago
Reply | Threaded
Open this post in threaded view
|

Re: Searching for database libraries

ashleyturnier
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mark Morgan Lloyd-5
The University of Louisville Library was one site that had a never-fading impression on me not only for its unique architectural plan but for other inexpressible qualities that make it an ideal place for quiet and serene study. My first visit was for an induction into the use of the internet in literature research. The class was fully equipped with computers in all the over fifty desks and a master screen monitor for the instructor. I passed through the library on many other occasions.