Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-12

PostgreSQL Questions

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tom Russell

I know there was a patch for the postgres unit in fpc so that the const set for the libpq stuff was not hard coded but I do not understand how the unit(s) find the path to which the libpq resides?

I don't understand at least on OSX how I have to set a sym link for the file in Usr/Lib for the db connection to work. What if a developer had only access to the db on a server somewhere? Would you still need the libpq file just to develop? And what about distributing your app afterwards, what do you have to supply with it in order for it to actually work?

Thanks,

Tom

Reply by email

Marco van de Voort
to Tom Russell
Tom Russell wrote
I know there was a patch for the postgres unit in fpc so that the const set for the libpq stuff was not hard coded but I do not understand how the unit(s) find the path to which the libpq resides?

Afaik already 2.4.4 allows to override the lib location and name in the main program

I don't understand at least on OSX how I have to set a sym link for the file in Usr/Lib for the db connection to work.

Afaik a built in name is passed to the dlload OS call. For the rest it follows normal OS rules.

What if a developer had only access to the db on a server somewhere?

That would be the server part of the DB. The library above is the client part, and must run always on the system of the client application.

Would you still need the libpq file just to develop? And what about distributing your app afterwards, what do you have to supply with it in order for it to actually work?

Yes. There are some ways to integrate the library into the main program, but while that eases installation somewhat, it makes the installation highly rigid, and a minor database library update needs a new build.

Reply by email

Mark Morgan Lloyd
to Marco van de Voort
Marco van de Voort wrote
> What if a developer had only access to the db on a server somewhere? That would be the server part of the DB. The library above is the client part, and must run always on the system of the client application.

The client app could, of course, be running on the server. In which case since the psql program would be installed for maintenance purposes I'd expect the libpq client library to be available- somewhere.

Show quoted text 7 lines
> Would you still need the libpq file just to develop? And what about > distributing your app afterwards, what do you have to supply with it in > order for it to actually work? Yes. There are some ways to integrate the library into the main program, but while that eases installation somewhat, it makes the installation highly rigid, and a minor database library update needs a new build.

PostgreSQL is fairly tolerant of mismatch between the server and client, but ultimately it's the site administrator's responsibility to ensure that if a Postgres server is available then the appropriate libraries are available to users.

Once the RTL does accept an explicit location for libpq (and I think this is later than 2.4.4), then it should be possible to distribute a fallback version of the library which can be installed wherever the user has access.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email