LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 08-19-2002, 01:39 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
PostgreSQL on FreeBSD


I tried to install and run postgreSQL 7.0.3 on two machines:
On my home machine, which is a Linux one, I succeeded.
I did not suceed, however, on a FreeBSD server, which would be the more important.
Compilation and intallation went smooth and without error messages, but when I try to connect psql to the 5432 tcp port, it cannot find the
postmaster there. ps -ax shows that postmaster is actually not running in spite that I started it as on Linux.
I am a green newbie to network configuration of servers. Could you, please advise me what to check in order that I could make postmaster running?
I do not know the details but I know that the internet side of that server is protected by a firewall. I only want to setup postgreSQL for the internal intranet network. Can the internet firewall prevent that?

Last edited by J_Szucs; 08-19-2002 at 01:40 PM.
 
Old 08-19-2002, 06:29 PM   #2
elb
LQ Newbie
 
Registered: Apr 2002
Posts: 19

Rep: Reputation: 0
Did you start postmaster with -i ?
 
Old 08-20-2002, 01:14 AM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I already tried -i and also -i -p 5432.
None of them worked.

One more question: If want to use ODBC only on the client machines for connecting to the server, do I have to ./configure postgreSQL with the --with-odbc option on the server?

Last edited by J_Szucs; 08-20-2002 at 01:30 AM.
 
Old 08-20-2002, 06:01 AM   #4
elb
LQ Newbie
 
Registered: Apr 2002
Posts: 19

Rep: Reputation: 0
Are you installing postgres manually or from the ports system? If you are doing in manually I would strongly suggest you remove what you have installed, then go install it from the ports system.

# cd /usr/ports/databases/postgresql7
# make install


The posts system will take care of the changes to postgresql that need to be made to both configure and to the source code (pg_passwd.c in particular) to make sure that postgresql will run properly on FreeBSD.

After you've run initdb as the pgsql user, copy /usr/local/share/postgresql.conf.sample to postgresql.conf, and change "#tcpip_socket = false" to true and uncomment it. Then run #/usr/local/etc/rc.d/010.pgsql.sh restart . You'll be able to connect to port 5432.

As for ODBC, first run /usr/local/share/postgresql/odbc.sql to prepare postgres for odbc access. If your clients are all win32 based, thats all you have to do. If your clients are unix based, you'll need to install the /usr/ports/databases/postgresql-odbc port as well.
 
Old 08-20-2002, 09:39 AM   #5
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I installed it manually.
It was because our system administrator did not install the ports system of FreeBSD (and I myself do not have a FreeBSD installation CD while our internet connection is too slow to use ftp for that).
Yet, the first time I downloaded a FreeBSD port of PostgreSQL from www.freebsd.org, and tried to install that manually but I was confused:
I found PostgreSQL 7.2.1 in the ports database at www.FreeBSD.org,, but there were two alternatives ways of downloading the port:
A) clicking on the download link, I got into an ftp directory of PostgreSQL, where there was no configure file or anything else that could be an install script, so I did not know how to use the package for instalIation
B) clicking on the source link, I could download the sources, but
-there were two tarball packages: a base and an opt package;
- I thought I also needed the opt package; but noticed that it did not contain a configure file,
- so I decided to extract both packages into the same directory and compile them in one turn (./configure, gmake, gmake install),
- compilation always stopped with errors
After some days of trying to use the ports in vain, I decided to download the sources of an older version of PostgreSQL and compile it manually.
Here I did not got error messages during compilation and installation, but it is not operable.

Last edited by J_Szucs; 08-20-2002 at 10:05 AM.
 
Old 08-20-2002, 12:32 PM   #6
elb
LQ Newbie
 
Registered: Apr 2002
Posts: 19

Rep: Reputation: 0
The entire ports tree is only 16 megs gzipped. You can get it from ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports.tar.gz then create a /usr/ports directory and extract the tarball there.

As for using a port, you don't have to run configure or anything. All you do is cd into the directory of the port you want to install and type # make install and it will do everything for you. Namely, it will:

a) fetch the sources for the port you want
b) extract the sources
c) patch the sources
d) configure
e) make
f) install the files in the appropriate places

And if there's anything that the port you are installing needs to build or run, it pauses and goes and does a "make install" on the required port, then comes back and continues.

All automatically.

Check out the Installing Ports section of the FreeBSD Handbook

And you can also use tools like cvsup to download changes to the ports tree as they occur (like when ports are upgraded) without being bandwidth intensive, and portupgrade to automatically upgrade ports to their latest versions without breaking dependencies.

As I said, its only 16 megs, and it will make your like much easier.
 
Old 08-20-2002, 01:17 PM   #7
algould
LQ Newbie
 
Registered: Jul 2002
Distribution: FreeBSD 4.6 Stable, Mac OS X
Posts: 24

Rep: Reputation: 15
If you manually install PostgreSQL, you need to initialize the database. The full installation instructions are in a text file that comes with the source code.

If you're a newbie at this, I'd suggest installing a FreeBSD prebuilt package at FreeBSD's ftp site using pkg_add. pkg_add will take care of any dependencies, just as the port system does. For PostgreSQL 7.2.1, execute:

pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/po...ql-7.2.1_1.tgz

(The command above should be one line.)

Best of luck,

Andrew Gould
 
Old 08-21-2002, 01:05 PM   #8
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
No success, again:

I uninstalled postgresql version 7.0.3, downloaded the FreeBSD ports tree and started the downloading and installation of postgresql via the ports tree (using 'make install').
Downloading of postgresql 7.2.1 seemed to be OK, but the compilation stopped again. Here are the last error messages:

access/SUBSYS.o: In function 'heap-update':
access/SUBSYS.ol.text+0xa792: undefined reference to 'GetCurrentCommandId'
gmake[3]: ***[postgres] Error 1
gmake[3]: Leaving directory '/usr/ports/databases/postgresql7/work/postgresql-7.2.1/src/backend'
gmake[2]: Leaving directory '/usr/ports/databases/postgresql7/work/postgresql-7.2.1/src
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory '/usr/ports/databases/postgresql7/work/work/postgresql-7.2.1
gmake: *** [all] Error 2
*** Error code 2
stop in /usr/ports/databases/postgresql7
*** Error code 1
stop in /usr/ports/databases/postgresql7

And compilation died.

It seems that I cannot compile postgresql 7.2.1 on this FreeBSD system. Should not I try 7.0.3 again?

Last edited by J_Szucs; 08-21-2002 at 01:07 PM.
 
Old 08-21-2002, 01:30 PM   #9
algould
LQ Newbie
 
Registered: Jul 2002
Distribution: FreeBSD 4.6 Stable, Mac OS X
Posts: 24

Rep: Reputation: 15
I've never had a ports compilation of PostgreSQL fail.

I note that your first attempt was to install PostgreSQL 7.0.3. This begs the question as to which version of FreeBSD you are running. If your version of FreeBSD is old enough, you may have to update the os to be compatible with the newer ports.

Andrew Gould
 
Old 08-21-2002, 03:39 PM   #10
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
It is a FreeBSD 4.4-stable system - a bit old, but since I am not the system administrator, I cannot easily manage a system update.
I would rather use an old version of postgresql (7.0.3 for example). Is it possible to find ancient ports for ancient FreeBSD systems?
 
Old 08-21-2002, 04:02 PM   #11
algould
LQ Newbie
 
Registered: Jul 2002
Distribution: FreeBSD 4.6 Stable, Mac OS X
Posts: 24

Rep: Reputation: 15
FreeBSD 4.4 isn't that old. You might post the error messages on the pgsql-general mailing list. Several of the developers frequent that list.

Best of luck,

Andrew Gould
 
Old 08-22-2002, 01:12 AM   #12
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Wow! I got it!

By the first glance I missed that the name of the function indicated as missing was 'GetCqrrentCommandId' and not 'GetCurrentCommandId'.

So it was only a letter error in file heapam.c! When I corrected it, postgresql-7.2.1 compiled well.

So, all that may have been due to a transmission error when downloading the sources. But: should not be there a CRC checking during installation?
 
Old 08-22-2002, 02:33 AM   #13
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Cooled down by postgres again...

Initdb gives the following error:
creating template1 database in /data2/data/base/l... Segmentation fault - core dumped
 
Old 08-22-2002, 05:39 AM   #14
elb
LQ Newbie
 
Registered: Apr 2002
Posts: 19

Rep: Reputation: 0
Yes, there should be a CRC check before the sources are extracted. An MD5 checksum is taken of the sources and compared to the MD5 checksum recorded in the file distinfo. If the checksums don't match, make install will stop and warn you.

The "typo" of GetCqrrentCommandId in heap.c is very very strange.

I've also never had a compilation of Postgresql on FreeBSD fail...

What signal does the core dump give you? If it is a signal 11, that is usually indicative of a hardware problem (memory, most likely).
 
Old 08-22-2002, 06:07 AM   #15
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
It is signal 11:

castor /kernel: pid 18260 (postgres), uid 1069: exited on signal 11 (core dumped)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
As a FreeBSD user, what is the best things you like about FreeBSD? t3gah *BSD 6 06-10-2005 02:38 PM
PostgreSQL 7.3.2 redhatrosh Programming 6 06-01-2005 08:15 PM
need help in postgresql yawhum80 Linux - Newbie 0 10-28-2003 10:03 AM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM
PostgreSQL dorian33 Linux - Software 3 01-15-2003 04:01 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration