Thread: mac install question

mac install question

From
"epicwinter@hotmail.com"
Date:
Please excuse my lack of mac knowledge.  I installed postgresql 8.3 using the mac os x 1 click installer onto my brand
newpowerbook.  The install appeared to go very smooth.  If I go to Postgresql under Applications it appears as if I can
startand stop postgres and open pgadmin.  I even created a test database under pgadmin with no errors.   So everything
appearscool but... 

I can't seem to run any of the postgresql commands from a shell.  If I open a terminal and try to run psql or createdb
orany of the commands I get this error: 

/Library/PostgreSQL/8.3/bin/createdb test
dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib
  Referenced from: /Library/PostgreSQL/8.3/bin/createdb
  Reason: image not found
Trace/BPT trap

OR here is me running the psql command

./psql
dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib
  Referenced from: /Library/PostgreSQL/8.3/bin/./psql
  Reason: image not found
Trace/BPT trap

The directory /Users/buildfarm doesn't even appear to exist.

I don't have much experience using mac much less the mac terminal so I assume since everything works from the
Applications/PostgreSQL8.3 Gui that I must just be doing something wrong.    

Any help appreciated thanks
_________________________________________________________________
Time for vacation? WIN what you need- enter now!
http://www.gowindowslive.com/summergiveaway/?ocid=tag_jlyhm

Re: mac install question

From
"Douglas McNaught"
Date:
On Wed, Jul 23, 2008 at 1:58 PM, epicwinter@hotmail.com
<epicwinter@hotmail.com> wrote:
>
> Please excuse my lack of mac knowledge.  I installed postgresql 8.3 using the mac os x 1 click installer onto my
brandnew powerbook.  The install appeared to go very smooth.  If I go to Postgresql under Applications it appears as if
Ican start and stop postgres and open pgadmin.  I even created a test database under pgadmin with no errors.   So
everythingappears cool but... 
>
> I can't seem to run any of the postgresql commands from a shell.  If I open a terminal and try to run psql or
createdbor any of the commands I get this error: 
>
> /Library/PostgreSQL/8.3/bin/createdb test
> dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib

That would seem to indicate that the installer doesn't set things up
properly for command-line access.  You should talk to whoever created
it, since it isn't (to my knowledge) part of the official Postgres
distribution.

-Doug

Re: mac install question

From
"epicwinter@hotmail.com"
Date:
> Date: Wed, 23 Jul 2008 14:12:45 -0400
> From: doug@mcnaught.org
> To: epicwinter@hotmail.com
> Subject: Re: [GENERAL] mac install question
> CC: pgsql-general@postgresql.org
>
> On Wed, Jul 23, 2008 at 1:58 PM, epicwinter@hotmail.com
> <epicwinter@hotmail.com> wrote:
> >
> > Please excuse my lack of mac knowledge. I installed postgresql 8.3 using the mac os x 1 click installer onto my brand new powerbook. The install appeared to go very smooth. If I go to Postgresql under Applications it appears as if I can start and stop postgres and open pgadmin. I even created a test database under pgadmin with no errors. So everything appears cool but...
> >
> > I can't seem to run any of the postgresql commands from a shell. If I open a terminal and try to run psql or createdb or any of the commands I get this error:
> >
> > /Library/PostgreSQL/8.3/bin/createdb test
> > dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib
>
> That would seem to indicate that the installer doesn't set things up
> properly for command-line access. You should talk to whoever created
> it, since it isn't (to my knowledge) part of the official Postgres
> distribution.
>
> -Doug


Well I got it from a link on postgresql.org.  Of course it does say that it is a beta installer.
http://www.postgresql.org/download/macosx



Keep your kids safer online with Windows Live Family Safety. Help protect your kids.

Re: mac install question

From
"Douglas McNaught"
Date:
On Wed, Jul 23, 2008 at 2:19 PM, epicwinter@hotmail.com
<epicwinter@hotmail.com> wrote:

> Well I got it from a link on postgresql.org.  Of course it does say that it
> is a beta installer.
> http://www.postgresql.org/download/macosx

Well, hopefully the maintainer reads this mailing list then.  :)

-Doug

Re: mac install question

From
dpage@pgadmin.org
Date:
He does, though he's currently on vacation, being forced to top-post
in the gmail mobile interface :-p

Can the OP send me (privately) the bitrock_installer log from /tmp please?
Thanks, Dave

On 7/23/08, Douglas McNaught <doug@mcnaught.org> wrote:
> On Wed, Jul 23, 2008 at 2:19 PM, epicwinter@hotmail.com
> <epicwinter@hotmail.com> wrote:
>
>> Well I got it from a link on postgresql.org.  Of course it does say that
>> it
>> is a beta installer.
>> http://www.postgresql.org/download/macosx
>
> Well, hopefully the maintainer reads this mailing list then.  :)
>
> -Doug
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: mac install question

From
"A.M."
Date:

On Jul 23, 2008, at 2:19 PM, epicwinter@hotmail.com wrote:

> Date: Wed, 23 Jul 2008 14:12:45 -0400
> From: doug@mcnaught.org
> To: epicwinter@hotmail.com
> Subject: Re: [GENERAL] mac install question
> CC: pgsql-general@postgresql.org
> 
> On Wed, Jul 23, 2008 at 1:58 PM, epicwinter@hotmail.com
> <epicwinter@hotmail.com> wrote:
> >
> > Please excuse my lack of mac knowledge. I installed postgresql 8.3 using the mac os x 1 click installer onto my brand new powerbook. The install appeared to go very smooth. If I go to Postgresql under Applications it appears as if I can start and stop postgres and open pgadmin. I even created a test database under pgadmin with no errors. So everything appears cool but...
> >
> > I can't seem to run any of the postgresql commands from a shell. If I open a terminal and try to run psql or createdb or any of the commands I get this error:
> >
> > /Library/PostgreSQL/8.3/bin/createdb test
> > dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib
> 
> That would seem to indicate that the installer doesn't set things up
> properly for command-line access. You should talk to whoever created
> it, since it isn't (to my knowledge) part of the official Postgres
> distribution.
> 
> -Doug


Well I got it from a link on postgresql.org.  Of course it does say that it is a beta installer.
http://www.postgresql.org/download/macosx

The package is improperly linked so the command-line tools are useless on any machine other than the buildfarm setup. Dave Page (CC'd) is apparently the maintainer.

Cheers,
M

Re: mac install question

From
dpage@pgadmin.org
Date:
Thanks for the log. It shows that the otool utility couldn't be found
(which should be a fatal error but that's another issue.

Is the otool program on your system anywhere? Afaik, it should be on
any Mac, but maybe it's part of xcode (i hope not- can anyone
confirm?)

In any case, re-running the installer, with otool in the standard
location should fixup the installation.


On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>
> Here is the log.  Is there a better way to install postgres that you would
> recommend?
> ----------------------------------------
>> Date: Wed, 23 Jul 2008 20:01:07 +0100
>> From: dpage@pgadmin.org
>> To: doug@mcnaught.org
>> Subject: Re: [GENERAL] mac install question
>> CC: epicwinter@hotmail.com; pgsql-general@postgresql.org
>>
>> He does, though he's currently on vacation, being forced to top-post
>> in the gmail mobile interface :-p
>>
>> Can the OP send me (privately) the bitrock_installer log from /tmp please?
>> Thanks, Dave
>>
>> On 7/23/08, Douglas McNaught  wrote:
>>> On Wed, Jul 23, 2008 at 2:19 PM, epicwinter@hotmail.com
>>>  wrote:
>>>
>>>> Well I got it from a link on postgresql.org.  Of course it does say that
>>>> it
>>>> is a beta installer.
>>>> http://www.postgresql.org/download/macosx
>>>
>>> Well, hopefully the maintainer reads this mailing list then.  :)
>>>
>>> -Doug
>>>
>>> --
>>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-general
>>>
>>
>>
>> --
>> Dave Page
>> EnterpriseDB UK:   http://www.enterprisedb.com
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>
> _________________________________________________________________
> With Windows Live for mobile, your contacts travel with you.
> http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: mac install question

From
dpage@pgadmin.org
Date:
it's a command line utility.

On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>
> Frankly i have no idea what otool is?
>
>> Date: Wed, 23 Jul 2008 20:45:23 +0100
>> From: dpage@pgadmin.org
>> To: epicwinter@hotmail.com
>> Subject: Re: [GENERAL] mac install question
>> CC: pgsql-general@postgresql.org
>>
>> Thanks for the log. It shows that the otool utility couldn't be found
>> (which should be a fatal error but that's another issue.
>>
>> Is the otool program on your system anywhere? Afaik, it should be on
>> any Mac, but maybe it's part of xcode (i hope not- can anyone
>> confirm?)
>>
>> In any case, re-running the installer, with otool in the standard
>> location should fixup the installation.
>>
>>
>> On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>> >
>> > Here is the log.  Is there a better way to install postgres that you
>> > would
>> > recommend?
>> > ----------------------------------------
>> >> Date: Wed, 23 Jul 2008 20:01:07 +0100
>> >> From: dpage@pgadmin.org
>> >> To: doug@mcnaught.org
>> >> Subject: Re: [GENERAL] mac install question
>> >> CC: epicwinter@hotmail.com; pgsql-general@postgresql.org
>> >>
>> >> He does, though he's currently on vacation, being forced to top-post
>> >> in the gmail mobile interface :-p
>> >>
>> >> Can the OP send me (privately) the bitrock_installer log from /tmp
>> >> please?
>> >> Thanks, Dave
>> >>
>> >> On 7/23/08, Douglas McNaught  wrote:
>> >>> On Wed, Jul 23, 2008 at 2:19 PM, epicwinter@hotmail.com
>> >>>  wrote:
>> >>>
>> >>>> Well I got it from a link on postgresql.org.  Of course it does say
>> >>>> that
>> >>>> it
>> >>>> is a beta installer.
>> >>>> http://www.postgresql.org/download/macosx
>> >>>
>> >>> Well, hopefully the maintainer reads this mailing list then.  :)
>> >>>
>> >>> -Doug
>> >>>
>> >>> --
>> >>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> >>> To make changes to your subscription:
>> >>> http://www.postgresql.org/mailpref/pgsql-general
>> >>>
>> >>
>> >>
>> >> --
>> >> Dave Page
>> >> EnterpriseDB UK:   http://www.enterprisedb.com
>> >>
>> >> --
>> >> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> >> To make changes to your subscription:
>> >> http://www.postgresql.org/mailpref/pgsql-general
>> >
>> > _________________________________________________________________
>> > With Windows Live for mobile, your contacts travel with you.
>> > http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008
>>
>>
>> --
>> Dave Page
>> EnterpriseDB UK:   http://www.enterprisedb.com
>
> _________________________________________________________________
> Stay in touch when you're away with Windows Live Messenger.
> http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_messenger2_072008


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: mac install question

From
dpage@pgadmin.org
Date:
that'll make it work, but doesn't fix the problem. :-(
On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>
> Well scott's suggestion seemed to work:
>
>
> Ryan,
>
>
>
>
>
>     Try setting:
>
>
>
>      export DYLD_LIBRARY_PATH=/Library/PostgreSQL/8.3/lib:$DYLD_LIBRARY_PATH
>
>
>
>     and running the command again.
>
>
>
> --
>
> Scott Mead
>
> Sr. Systems Engineer
>
> EnterpriseDB
>
>> Date: Wed, 23 Jul 2008 20:50:13 +0100
>> From: dpage@pgadmin.org
>> To: epicwinter@hotmail.com
>> Subject: Re: [GENERAL] mac install question
>> CC: pgsql-general@postgresql.org
>>
>> it's a command line utility.
>>
>> On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>> >
>> > Frankly i have no idea what otool is?
>> >
>> >> Date: Wed, 23 Jul 2008 20:45:23 +0100
>> >> From: dpage@pgadmin.org
>> >> To: epicwinter@hotmail.com
>> >> Subject: Re: [GENERAL] mac install question
>> >> CC: pgsql-general@postgresql.org
>> >>
>> >> Thanks for the log. It shows that the otool utility couldn't be found
>> >> (which should be a fatal error but that's another issue.
>> >>
>> >> Is the otool program on your system anywhere? Afaik, it should be on
>> >> any Mac, but maybe it's part of xcode (i hope not- can anyone
>> >> confirm?)
>> >>
>> >> In any case, re-running the installer, with otool in the standard
>> >> location should fixup the installation.
>> >>
>> >>
>> >> On 7/23/08, epicwinter@hotmail.com <epicwinter@hotmail.com> wrote:
>> >> >
>> >> > Here is the log.  Is there a better way to install postgres that you
>> >> > would
>> >> > recommend?
>> >> > ----------------------------------------
>> >> >> Date: Wed, 23 Jul 2008 20:01:07 +0100
>> >> >> From: dpage@pgadmin.org
>> >> >> To: doug@mcnaught.org
>> >> >> Subject: Re: [GENERAL] mac install question
>> >> >> CC: epicwinter@hotmail.com; pgsql-general@postgresql.org
>> >> >>
>> >> >> He does, though he's currently on vacation, being forced to top-post
>> >> >> in the gmail mobile interface :-p
>> >> >>
>> >> >> Can the OP send me (privately) the bitrock_installer log from /tmp
>> >> >> please?
>> >> >> Thanks, Dave
>> >> >>
>> >> >> On 7/23/08, Douglas McNaught  wrote:
>> >> >>> On Wed, Jul 23, 2008 at 2:19 PM, epicwinter@hotmail.com
>> >> >>>  wrote:
>> >> >>>
>> >> >>>> Well I got it from a link on postgresql.org.  Of course it does
>> >> >>>> say
>> >> >>>> that
>> >> >>>> it
>> >> >>>> is a beta installer.
>> >> >>>> http://www.postgresql.org/download/macosx
>> >> >>>
>> >> >>> Well, hopefully the maintainer reads this mailing list then.  :)
>> >> >>>
>> >> >>> -Doug
>> >> >>>
>> >> >>> --
>> >> >>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> >> >>> To make changes to your subscription:
>> >> >>> http://www.postgresql.org/mailpref/pgsql-general
>> >> >>>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Dave Page
>> >> >> EnterpriseDB UK:   http://www.enterprisedb.com
>> >> >>
>> >> >> --
>> >> >> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> >> >> To make changes to your subscription:
>> >> >> http://www.postgresql.org/mailpref/pgsql-general
>> >> >
>> >> > _________________________________________________________________
>> >> > With Windows Live for mobile, your contacts travel with you.
>> >> > http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008
>> >>
>> >>
>> >> --
>> >> Dave Page
>> >> EnterpriseDB UK:   http://www.enterprisedb.com
>> >
>> > _________________________________________________________________
>> > Stay in touch when you're away with Windows Live Messenger.
>> > http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_messenger2_072008
>>
>>
>> --
>> Dave Page
>> EnterpriseDB UK:   http://www.enterprisedb.com
>
> _________________________________________________________________
> Keep your kids safer online with Windows Live Family Safety.
> http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_WL_family_safety_072008


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: mac install question

From
Tom Lane
Date:
dpage@pgadmin.org writes:
> Thanks for the log. It shows that the otool utility couldn't be found
> (which should be a fatal error but that's another issue.

> Is the otool program on your system anywhere? Afaik, it should be on
> any Mac, but maybe it's part of xcode (i hope not- can anyone
> confirm?)

Looks like you lose.  I'm not sure where to look for definitive package
contents on Macs, but the file timestamp on /usr/bin/otool shows it was
built at the same time as ar, as, gcc, gprof, size, RezWack, and a bunch
of other /usr/bin programs that look like they'd only come as part of
xcode not in the base install.

What are you using it for that you need it to be present at install
time?

            regards, tom lane

Re: mac install question

From
Dave Page
Date:
On 23 Jul 2008, at 21:47, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> dpage@pgadmin.org writes:
>> Thanks for the log. It shows that the otool utility couldn't be found
>> (which should be a fatal error but that's another issue.
>
>> Is the otool program on your system anywhere? Afaik, it should be on
>> any Mac, but maybe it's part of xcode (i hope not- can anyone
>> confirm?)
>
> Looks like you lose.  I'm not sure where to look for definitive
> package
> contents on Macs, but the file timestamp on /usr/bin/otool shows it
> was
> built at the same time as ar, as, gcc, gprof, size, RezWack, and a
> bunch
> of other /usr/bin programs that look like they'd only come as part of
> xcode not in the base install.
>
> What are you using it for that you need it to be present at install
> time?

The linker hardcodes library paths into exes and libs. We examine
these paths at install time using otool and rewrite them from the
staging paths on the build machine to whatever directory the user
chose to install to using install_name_tool(1).

The other option would be to rewrite the paths to be relative at build
time I guess.

/D

Re: mac install question

From
Craig Ringer
Date:
Dave Page wrote:

> The linker hardcodes library paths into exes and libs. We examine these
> paths at install time using otool and rewrite them from the staging
> paths on the build machine to whatever directory the user chose to
> install to using install_name_tool(1).

Yep, the mac linker seems to default to absolute rpath linking, which I
personally find *really* frustrating.

> The other option would be to rewrite the paths to be relative at build
> time I guess.

That's the approach most Mac apps take, and is supported by the @
relative path syntax in install_name_tool.

--
Craig Ringer

Re: mac install question

From
Shane Ambler
Date:
dpage@pgadmin.org wrote:

> Is the otool program on your system anywhere? Afaik, it should be on
> any Mac, but maybe it's part of xcode (i hope not- can anyone
> confirm?)

I have a few installs here.

otool is included inside /Developer/usr/bin
my working 10.4 that the dev tools is installed on also includes otool
at /usr/bin

A minimal 10.3 install has otool at /usr/bin

A clean 10.5 install does not have otool



--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

Re: mac install question

From
Tom Lane
Date:
Dave Page <dpage@pgadmin.org> writes:
>> What are you using it for that you need it to be present at install
>> time?

> The linker hardcodes library paths into exes and libs. We examine
> these paths at install time using otool and rewrite them from the
> staging paths on the build machine to whatever directory the user
> chose to install to using install_name_tool(1).

> The other option would be to rewrite the paths to be relative at build
> time I guess.

Relative paths sound like the best solution to me, assuming they work.

            regards, tom lane

Re: mac install question

From
John DeSoi
Date:
On Jul 24, 2008, at 1:51 AM, Tom Lane wrote:

> Relative paths sound like the best solution to me, assuming they work.

Relative paths work fine. I use this all the time for distributing
psql. It looks something like this:

install_name_tool -change /path/to/postgresql/lib/libpq.dylib
@executable_path/../lib/libpq.dylib psql



John DeSoi, Ph.D.





Re: mac install question

From
Shane Ambler
Date:
Shane Ambler wrote:
> dpage@pgadmin.org wrote:
>
>> Is the otool program on your system anywhere? Afaik, it should be on
>> any Mac, but maybe it's part of xcode (i hope not- can anyone
>> confirm?)
>
> I have a few installs here.

now that I think about it - it may be a dev tools only thing.

> otool is included inside /Developer/usr/bin
> my working 10.4 that the dev tools is installed on also includes otool
> at /usr/bin

This has been running for a few years so otool at /usr/bin may have come
from anywhere.

> A minimal 10.3 install has otool at /usr/bin

I have two 10.3 systems here the one that has otool is an emergency boot
setup by TechTool Pro. A normal 10.3 install does not have otool.

> A clean 10.5 install does not have otool
>


--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

Re: mac install question

From
"Dave Page"
Date:
On Thu, Jul 24, 2008 at 12:55 PM, John DeSoi <desoi@pgedit.com> wrote:
>
> On Jul 24, 2008, at 1:51 AM, Tom Lane wrote:
>
>> Relative paths sound like the best solution to me, assuming they work.
>
> Relative paths work fine. I use this all the time for distributing psql. It
> looks something like this:
>
> install_name_tool -change /path/to/postgresql/lib/libpq.dylib
> @executable_path/../lib/libpq.dylib psql

Yeah, we do that in pgAdmin. In the installer though we have far more
executables and libraries in various locations, and scripting the
required changes (without hardcoding for specific filenames which is a
recipe for future bugs) will be much more tricky.

The other downside is that I won't be able to set the library install
name correctly of course. I'll have to change that to just the
filename.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: mac install question

From
"Dave Page"
Date:
On Thu, Jul 24, 2008 at 3:57 PM, Shane Ambler <pgsql@sheeky.biz> wrote:
> Shane Ambler wrote:
>>
>> dpage@pgadmin.org wrote:
>>
>>> Is the otool program on your system anywhere? Afaik, it should be on
>>> any Mac, but maybe it's part of xcode (i hope not- can anyone
>>> confirm?)
>>
>> I have a few installs here.
>
> now that I think about it - it may be a dev tools only thing.

Yeah, was afraid of that. Thanks for checking.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: mac install question

From
"Dave Page"
Date:
On Thu, Jul 24, 2008 at 6:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dave Page <dpage@pgadmin.org> writes:
>>> What are you using it for that you need it to be present at install
>>> time?
>
>> The linker hardcodes library paths into exes and libs. We examine
>> these paths at install time using otool and rewrite them from the
>> staging paths on the build machine to whatever directory the user
>> chose to install to using install_name_tool(1).
>
>> The other option would be to rewrite the paths to be relative at build
>> time I guess.
>
> Relative paths sound like the best solution to me, assuming they work.

For info, the latest version of the installer (download from
http://www.enterprisedb.com/products/pgdownload.do) fixes this
problem.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com