HowTo use PostgreSQL in FB

Linux specific questions.
Post Reply
79d
Posts: 4
Joined: Oct 01, 2019 19:02

HowTo use PostgreSQL in FB

Post by 79d »

I've installed FB in Fedora 30 Server 64 bit. I've also installed PostgreSQL. Can someone please provide a howto use PostgreSQL in FB?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: HowTo use PostgreSQL in FB

Post by MrSwiss »

Hi 79d,

apparently, PostgreSQL is not much used in FB. I've just found this thread:
ld.exe: cannot find -lpq (having trouble getting started using postgresql library)
79d
Posts: 4
Joined: Oct 01, 2019 19:02

Re: HowTo use PostgreSQL in FB

Post by 79d »

Thank you for the response. I saw that, but seems to be for a Windows install. I'll read more to see if I can get some ideas. Thank you.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: HowTo use PostgreSQL in FB

Post by caseih »

What issues are you having? If you have the proper postgresql devel rpm installed, I believe the postgresql bi file included in FreeBASIC should work without issue.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: HowTo use PostgreSQL in FB

Post by badidea »

I see to following related files in FreeBASIC-1.07.0:

examples/database/postgresql_test.bas
include/freebasic/postgresql/postgres_ext.bi
include/freebasic/postgresql/libpq-fe.bi

If they are up-to-date, I do not know.
79d
Posts: 4
Joined: Oct 01, 2019 19:02

Re: HowTo use PostgreSQL in FB

Post by 79d »

Well, I reinstalled. I get this error message:

fbc postgresql_test.bas
fbc: /lib64/libtinfo.so.5: no version information available (required by fbc)
fbc: Symbol `ospeed' has different size in shared object, consider re-linking

I saw the same errors when I tried to compile from the GitHub source.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: HowTo use PostgreSQL in FB

Post by MrSwiss »

Have a look at: "Missing lib(s) on Ubuntu install" (under "Platforms Linux").
It seems to deal with the same issue ... libtinfo.so.5
You might have to install the dev / devel version (not the plain one).
Secondly, the bitness of the lib, must be equal, to the FBC bitness.
79d
Posts: 4
Joined: Oct 01, 2019 19:02

Re: HowTo use PostgreSQL in FB

Post by 79d »

I noticed that fbc did compile the bas file, and I was able to execute it just fine. I didn't want to just leave those errors, so I compiled from the current GitHub source. Also the lib was there and apparently the ospeed was just a warning error. Because during the compile, fbc is required, the same errors popped up. I had to also install gpm (dnf install gpm*) for the compilation to complete; likely because I'm using fedora 30 server.
Post Reply