PostgreSQL 7.1.3 Install Problems

ddregs

Registered
Hi all of you,
I'm very new and very attracted to OS X. I'm a newbie Unix user, so please excuse me for my poor knowledge...
I tried to download and compile by myself PostgreSQL 7.1.3, grabbing the postgresql-7.1.3.tar.gz via ftp from one of the mirror servers.
I then ran gunzip, tar -xvf and got the directory full of the sources.
All of this using the root account.
Then I did the configure using the following string:
./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man/ --docdir=/usr/local/share/doc/ --enable-recode --with-CXX --enable-odbc --enable-syslog --enable-unicode-conversion --enable-multibyte --enable-debug

It all went fine.

The problems were when I did make.
In the final rows I had these errors:

/usr/bin/ld: -undefined error must be used when -twolevel_namespace is in effect
make[3]: *** [libpq.so.2.1] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

I had only two strange thing, this one

make -C doc all
make[1]: Nothing to be done for `all'.

and a warning for a parameter undeclared, but no errors at all.

Can you help me to make it compile?

Thanks so much in advance! Please notice I'm using 5G15 if this can make a point...
 

howardm4

Registered
it's making a dynamic library and that requires an additional
command line argument such as '-undefined suppress' so that
the linker wont toss an error when it gets an undefined
symbol.
 

ddregs

Registered
And...
how can I make it work? Should I change something in the make files and where?

Thanks a lot
 

howardm4

Registered
It may/probably is more complex (ie. you'll need to do more than jsut this) but I'd start
w/ altering the makefile that controls building of that object
and adding '-undefined suppress' to the final linking step.

I haven't tried compiling postrgres so I dont know the details.
I thought stepwise had a writeup on it?
 

ddregs

Registered
howardm4,
thanks a lot for your support.
I believe the problem is in 5G15, but I don't have the final proof of it.
I tried to compile Postgre with debug just because I downloaded the package from www.entropy.ch and it all worked fine under 10.0.4.
Under 5G15 at the first attempt to create a test database it returns pgReadData error, and it doesn't work.
So I decided to download the sources and try to compile it by myself, but this is just my first Unix adventure (though I'm a C programmer).
I'll try your suggestions and give you some feedback about that.

Regards
 

millerp

Registered
PostgreSQL 7.1.2 installs without error using:

./configure
make
sudo make install

provided that you have already added the postgres user, created the /usr/local/pgsql/data directory and chown'ed it to postgres:

# mkdir /usr/local/pgsql/data
# chown postgres /usr/local/pgsql/data

From there, I can only suggest that one of the options (likely odbc?) you specified in your configure is causing the problem.

Try installing using just plain ./configure.

Regards

Paul Miller
 

millerp

Registered
I have followed this up, and 7.1.3 compiled first time for my configuration. I think some of your options are causing problems, and when I look at them, one or two look likely.

I tried your options one at a time, and the problem seems to be --enable-multibyte. If you don't need it, don't compile it in, and everything should work fine. It also means leaving out unicode conversion (since that is dependent on mutibyte) but unless you really need these features you can have a working PostgreSQL installation.

Finally, I forgot to mention that all of this is on 1.0.4, and I have heard (but not confirmed) that some things have changed on 10.1. I probably won't upgrade for some little time so others will have to confirm my results on 10.1.

For the record, the commands I used:

> tar xzf postrgesql-7.1.3.tar.gz && cd postgresql-7.1.3 && ./configure --enable-odbc --with-CXX && make

Feel free to contact me for more information if you need it.

Regards

Paul Miller
 

jkonopka

Registered
ah ha! - you're running 10.0.4! there's been a major change in ld under 10.1 (5g15, 5g48, and 5g64) that breaks postgres... postgresql 7.1.3 built fine for me under 10.0.4 too

it also seems that using a binary of postgresql 7.1.3 (I found a bunch out there) break under 10.1 as well... I'm switching to cloudscape for my db needs for the time being (at least until postgres is working under 10.1)


on a different vein, a 10.1 compatable fink (0.3.0) just came out this past sunday

download at:
http://fink.sourceforge.net/download/

upgrade at:
http://fink.sourceforge.net/download/upgrade.php
 

jimr

McInstigator
Originally posted by howardm4
it's making a dynamic library and that requires an additional
command line argument such as '-undefined suppress' so that
the linker wont toss an error when it gets an undefined
symbol.
from original post

/usr/bin/ld: -undefined error must be used when -twolevel_namespace is in effect
make[3]: *** [libpq.so.2.1] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2


the erro is the -undefined flag to the new default for ld: -twolevel_namespace

formerly the default was -flat_namespace


now you must explicitly give the directive.

do this before configure
setenv LDFLAGS -flat_namespace

make

and see if everything is OK

I have found that some configure scripts will not pick up the LDFLAGS env variable correctly so you still may have to manually search for instances of -undefined suppress and add the -flat_namespace.

places to watch are
ltconfig
configure
config.sub
Makefile.in
etc......
 

mntamago

Registered
I found that after updating from Mac OS X 10.0.4 PostgreSQL would no longer allow me to create databases. I was using PostgreSQL 7.1.2, so I figured I would try to update and reinstall to try and solve my problem. I found I could not get PostgreSQL to compile no matter what I did.

Relief can from the following page by Russ McBride of Psyex inc.

http://www.psyex.com/techdocs/pgonx.html

Recompiling/reinstalling went without a hitch. Yet, I found that my PATH was pointing to not my newly installed PostgreSQL parts, but to PostgreSQL parts in /usr/local/bin.

The resting error when trying createdb:
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
connection to server was lost
createdb: database creation failed


The semi-solution:

After restarting PostgreSQL with -
/usr/local/pgsql/bin/postmaster -i --B=1024

I found that I was am now able to create databases by using the full path to my newly installed PostgreSQL 7.1.3:

/usr/local/pgsql/bin/createdb testdb

(^ u ^) m(_ _)m
 
Top