Thread: pgsql and Mac OS X

pgsql and Mac OS X

From
Tom Allison
Date:
I'm trying to find the binaries for pgsql (the client) for Mac OSX.
Is there any way to get these without installing all of postgres on a
computer?

I'm not going to use postgres on my MacBook, just connect to it.

Re: pgsql and Mac OS X

From
Erik Jones
Date:
On Apr 30, 2007, at 2:28 PM, Tom Allison wrote:

> I'm trying to find the binaries for pgsql (the client) for Mac OSX.
> Is there any way to get these without installing all of postgres on
> a computer?
>
> I'm not going to use postgres on my MacBook, just connect to it.

If you have macports installed you can install the postgresql82 port
(not postgresql82-server).

erik jones <erik@myemma.com>
software developer
615-296-0838
emma(r)




Re: pgsql and Mac OS X

From
Tom Allison
Date:
I found psql in
/System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/psql
which means that I can, as a user, access the database from a Mac.
But I'm still unable to build the perl modules for DBD:Pg support.
And this one seems a bit screwed up from default.
Port is 5433, not 5432.
pg_config shows it configured with a prefix path that doesn't exist:
/System/Library/CoreServices/RemoteManagement/sqldb

And I'm starting to think I'm way out of my league on how to get this
working.

On Apr 30, 2007, at 3:45 PM, Erik Jones wrote:

> On Apr 30, 2007, at 2:28 PM, Tom Allison wrote:
>
>> I'm trying to find the binaries for pgsql (the client) for Mac OSX.
>> Is there any way to get these without installing all of postgres
>> on a computer?
>>
>> I'm not going to use postgres on my MacBook, just connect to it.
>
> If you have macports installed you can install the postgresql82
> port (not postgresql82-server).
>
> erik jones <erik@myemma.com>
> software developer
> 615-296-0838
> emma(r)
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that
> your
>       message can get through to the mailing list cleanly


Re: pgsql and Mac OS X

From
merlyn@stonehenge.com (Randal L. Schwartz)
Date:
>>>>> "Tom" == Tom Allison <tom@tacocat.net> writes:

Tom> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/psql

That's not on my mac.  Must be some bolt-on you installed.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: pgsql and Mac OS X

From
Michael Glaesemann
Date:
On Apr 30, 2007, at 16:20 , Randal L. Schwartz wrote:

>>>>>> "Tom" == Tom Allison <tom@tacocat.net> writes:
>
> Tom> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/
> psql
>
> That's not on my mac.  Must be some bolt-on you installed.

Apple Remote Desktop uses PostgreSQL as it's data store (at least
through version 2). I believe it's PostgreSQL 7.3, so the psql binary
isn't going to be much use in connecting to newer PostgreSQL servers,
and in any event I'm pretty sure the Remote Desktop installation does
not include the libraries necessary to build the Perl modules, even
if they were up to date. Better just to install via MacPorts or even
from source: it builds pretty easily on Mac OS X.

Michael Glaesemann
grzm seespotcode net



Re: pgsql and Mac OS X

From
Tom Lane
Date:
Tom Allison <tom@tacocat.net> writes:
> I found psql in
> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/psql
> which means that I can, as a user, access the database from a Mac.
> But I'm still unable to build the perl modules for DBD:Pg support.
> And this one seems a bit screwed up from default.
> Port is 5433, not 5432.

Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't think
they intend it for general use --- it deliberately uses a nonstandard
port to avoid conflicting with a regular PG server.  You could probably
use that psql if you explicitly set the port parameter, but that's a bit
of a pain.  They very possibly didn't bother to enable command history
in psql either, if it weren't intended to be used much, and that would
be a real big pain.  Lastly, if the header files aren't included
(haven't checked but seems highly likely) then you'd not be able to
use this installation to build any other PG-using code such as DBD:Pg.

What you can do if you want to build PG from source is build normally
but only install the client programs.  The Fine Manual recommends

     gmake -C src/bin install
     gmake -C src/include install
     gmake -C src/interfaces install
     gmake -C doc install

instead of the usual "gmake install".

            regards, tom lane

Re: pgsql and Mac OS X

From
Tom Allison
Date:
On Apr 30, 2007, at 5:20 PM, Randal L. Schwartz wrote:

>>>>>> "Tom" == Tom Allison <tom@tacocat.net> writes:
>
> Tom> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/
> psql
>
> That's not on my mac.  Must be some bolt-on you installed.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
> 777 0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!

So how did you get it working?
(I have no idea how this file got there.  Wouldn't know where to begin)

Re: pgsql and Mac OS X

From
Tom Allison
Date:
That might be the thing to do.
I'm wondering how Apple Remote Desktop got onto my machine and how to
remove it.

On Apr 30, 2007, at 5:38 PM, Michael Glaesemann wrote:

>
> On Apr 30, 2007, at 16:20 , Randal L. Schwartz wrote:
>
>>>>>>> "Tom" == Tom Allison <tom@tacocat.net> writes:
>>
>> Tom> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/
>> psql
>>
>> That's not on my mac.  Must be some bolt-on you installed.
>
> Apple Remote Desktop uses PostgreSQL as it's data store (at least
> through version 2). I believe it's PostgreSQL 7.3, so the psql
> binary isn't going to be much use in connecting to newer PostgreSQL
> servers, and in any event I'm pretty sure the Remote Desktop
> installation does not include the libraries necessary to build the
> Perl modules, even if they were up to date. Better just to install
> via MacPorts or even from source: it builds pretty easily on Mac OS X.
>
> Michael Glaesemann
> grzm seespotcode net
>
>


Re: pgsql and Mac OS X

From
Philip Hallstrom
Date:
>>
>> That's not on my mac.  Must be some bolt-on you installed.
>>
> So how did you get it working?
> (I have no idea how this file got there.  Wouldn't know where to begin)

Coming in late so maybe someone already posted this, but I used this:

http://www.postgresqlformac.com/

I wanted the server too, but looks like they have just hte client perhaps.

Re: pgsql and Mac OS X

From
Tom Lane
Date:
Tom Allison <tom@tacocat.net> writes:
> I'm wondering how Apple Remote Desktop got onto my machine and how to
> remove it.

There isn't any particular need to remove it; it won't conflict with
a standard PG installation.

            regards, tom lane

Re: pgsql and Mac OS X

From
merlyn@stonehenge.com (Randal L. Schwartz)
Date:
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

Tom> What you can do if you want to build PG from source is build normally
Tom> but only install the client programs.  The Fine Manual recommends

Tom>      gmake -C src/bin install
Tom>      gmake -C src/include install
Tom>      gmake -C src/interfaces install
Tom>      gmake -C doc install

Tom> instead of the usual "gmake install".

The Randal Notebook recommends:

  fink install postgresql

:-)

Then you get automatic startup on boot, usernames added, etc.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: pgsql and Mac OS X

From
Erik Jones
Date:
On Apr 30, 2007, at 5:03 PM, Tom Allison wrote:
>
> On Apr 30, 2007, at 5:38 PM, Michael Glaesemann wrote:
>
>>
>> On Apr 30, 2007, at 16:20 , Randal L. Schwartz wrote:
>>
>>>>>>>> "Tom" == Tom Allison <tom@tacocat.net> writes:
>>>
>>> Tom> /System/Library/CoreServices/RemoteManagement/rmdb.bundle/
>>> bin/psql
>>>
>>> That's not on my mac.  Must be some bolt-on you installed.
>>
>> Apple Remote Desktop uses PostgreSQL as it's data store (at least
>> through version 2). I believe it's PostgreSQL 7.3, so the psql
>> binary isn't going to be much use in connecting to newer
>> PostgreSQL servers, and in any event I'm pretty sure the Remote
>> Desktop installation does not include the libraries necessary to
>> build the Perl modules, even if they were up to date. Better just
>> to install via MacPorts or even from source: it builds pretty
>> easily on Mac OS X.
>>
>> Michael Glaesemann
>> grzm seespotcode net
>>
>>
>
>
> That might be the thing to do.
> I'm wondering how Apple Remote Desktop got onto my machine and how
> to remove it.

For now, I'd just ignore the one installed by Remote Desktop.  Once
you have Macports installed it will place the installation directory
for installed ports before the system directories in your path, or
maybe you'll have to do that, but it'll be spelled out one way or
another in the Macports installation docs.

erik jones <erik@myemma.com>
software developer
615-296-0838
emma(r)




Re: pgsql and Mac OS X

From
Michael Glaesemann
Date:
On Apr 30, 2007, at 16:39 , Tom Lane wrote:

> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't
> think
> they intend it for general use --- it deliberately uses a nonstandard
> port to avoid conflicting with a regular PG server.

Really? I've had the Remote Desktop postgres instance prevent others
from starting on the default port. Matter of fact, I see that it
started up on 5432 just right now. I wonder if the Remote Desktop
doesn't check if something else is running on 5432 on startup and use
another port if it's already in use. Note that I don't think the
Remote Desktop postgres instance starts on system startup; from
observation it looks like Remote Desktop needs to be launched for its
postgres server to start.

Michael Glaesemann
grzm seespotcode net



Re: pgsql and Mac OS X

From
Tom Allison
Date:
Please update the Randall Notebook to read:
sudo fink install dbd-pg-unified-pm586

Perhaps this will be done in time for YAPC?

On Apr 30, 2007, at 6:22 PM, Randal L. Schwartz wrote:

>>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>
> Tom> What you can do if you want to build PG from source is build
> normally
> Tom> but only install the client programs.  The Fine Manual recommends
>
> Tom>      gmake -C src/bin install
> Tom>      gmake -C src/include install
> Tom>      gmake -C src/interfaces install
> Tom>      gmake -C doc install
>
> Tom> instead of the usual "gmake install".
>
> The Randal Notebook recommends:
>
>   fink install postgresql
>
> :-)
>
> Then you get automatic startup on boot, usernames added, etc.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
> 777 0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!


Re: pgsql and Mac OS X

From
Tom Lane
Date:
Michael Glaesemann <grzm@seespotcode.net> writes:
> On Apr 30, 2007, at 16:39 , Tom Lane wrote:
>> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't
>> think
>> they intend it for general use --- it deliberately uses a nonstandard
>> port to avoid conflicting with a regular PG server.

> Really? I've had the Remote Desktop postgres instance prevent others
> from starting on the default port. Matter of fact, I see that it
> started up on 5432 just right now. I wonder if the Remote Desktop
> doesn't check if something else is running on 5432 on startup and use
> another port if it's already in use. Note that I don't think the
> Remote Desktop postgres instance starts on system startup; from
> observation it looks like Remote Desktop needs to be launched for its
> postgres server to start.

Hmm ... the default port wired into the executables definitely seems to
be 5433:

Mini:~ tgl$ /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/private/var/db/RemoteManagement/RMDB/.s.PGSQL.5433"?

Mini:~ tgl$ /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/postmaster --help
/System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/postmaster is the PostgreSQL server.
...
  -p PORT         port number to listen on (default 5433)
...

It's possible that Remote Desktop overrides that when starting the
postmaster; although dynamically choosing the port doesn't seem very
bright since you've got the problem of how do the clients know where
to connect?

            regards, tom lane

Re: pgsql and Mac OS X

From
John DeSoi
Date:
You can get libpq (and psql) from the pgEdit distribution. Just right
click on the application and choose "Show Package Contents".

You'll find these files in Contents/MacOS/bin

John

http://pgedit.com/public/pgedit/pgEdit_mac_1.3.dmg


On Apr 30, 2007, at 3:28 PM, Tom Allison wrote:

> I'm trying to find the binaries for pgsql (the client) for Mac OSX.
> Is there any way to get these without installing all of postgres on
> a computer?
>
> I'm not going to use postgres on my MacBook, just connect to it.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: pgsql and Mac OS X

From
Magnus Hagander
Date:
Tom Lane wrote:
> Michael Glaesemann <grzm@seespotcode.net> writes:
>> On Apr 30, 2007, at 16:39 , Tom Lane wrote:
>>> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't
>>> think
>>> they intend it for general use --- it deliberately uses a nonstandard
>>> port to avoid conflicting with a regular PG server.
>
>> Really? I've had the Remote Desktop postgres instance prevent others
>> from starting on the default port. Matter of fact, I see that it
>> started up on 5432 just right now. I wonder if the Remote Desktop
>> doesn't check if something else is running on 5432 on startup and use
>> another port if it's already in use. Note that I don't think the
>> Remote Desktop postgres instance starts on system startup; from
>> observation it looks like Remote Desktop needs to be launched for its
>> postgres server to start.
>
> Hmm ... the default port wired into the executables definitely seems to
> be 5433:

Not being a Mac user myself, I do seem to recall having read somewhere
that they changed this at some point. That early versions had it in
5432, but it was changed to 5433 in newer ones.

//Magnus


Re: pgsql and Mac OS X

From
Michael Glaesemann
Date:
On May 1, 2007, at 3:19 , Magnus Hagander wrote:

> Not being a Mac user myself, I do seem to recall having read somewhere
> that they changed this at some point. That early versions had it in
> 5432, but it was changed to 5433 in newer ones.

What a guy :) From the Apple developer site:
http://developer.apple.com/appleapplications/ardsql.html

> NOTE: With the release of Apple Remote Desktop 3 the default
> database access settings have changed slightly from 2.x, in order
> to be more compatible with an existing PostgreSQL installation and
> to be more secure:
>
>     * In ARD 3, the default port is now 5433. (A default PostgreSQL
> install uses 5432)

Not having ARD3 myself, anyone happen to know which version of
PostgreSQL Apple's shipping with version 3? My ARD2 installation is
running 7.3.3.

ard=> select version();)
                                                           version
------------------------------------------------------------------------
---------------------------------------------------
PostgreSQL 7.3.3 on powerpc-apple-darwin7.0.0b1, compiled by GCC gcc
(GCC) 3.3 20030304 (Apple Computer, Inc. build 1472)
(1 row)

Michael Glaesemann
grzm seespotcode net



Re: pgsql and Mac OS X

From
Tom Lane
Date:
Michael Glaesemann <grzm@seespotcode.net> writes:
> Not having ARD3 myself, anyone happen to know which version of
> PostgreSQL Apple's shipping with version 3? My ARD2 installation is
> running 7.3.3.

The Mini I bought last summer seems to have 7.3.10 installed on it.
Don't know where to look to determine the ARD version.

Which, btw, is sufficient reason for Tom not to be using these executables
anyway: one hopes the server he wants to talk to is running something
newer than 7.3.  Even though the 7.3 psql will successfully connect to
a newer server, a lot of stuff like backslash commands will probably not
work very well.

            regards, tom lane

Re: pgsql and Mac OS X

From
"Eddy D. Sanchez"
Date:
I've got PostgreSQL Client and server on my MacBook, just compiling
the last source code without problem, and I work with last PgAdmin.

I had problem with mac ports, and I decide install Xcode for
libraries and compile postgres from scratch, it works fine, without
any problem with libraries.



Re: pgsql and Mac OS X

From
Michael Glaesemann
Date:
On May 1, 2007, at 22:33 , Eddy D. Sanchez wrote:

> I had problem with mac ports, and I decide install Xcode for
> libraries and compile postgres from scratch, it works fine, without
> any problem with libraries.

MacPorts requires the Xcode Developer Tools, so that may have been
your problem.

Michael Glaesemann
grzm seespotcode net



Re: pgsql and Mac OS X

From
Michael Glaesemann
Date:
On May 1, 2007, at 10:11 , Tom Lane wrote:

> Michael Glaesemann <grzm@seespotcode.net> writes:
>> Not having ARD3 myself, anyone happen to know which version of
>> PostgreSQL Apple's shipping with version 3? My ARD2 installation is
>> running 7.3.3.
>
> The Mini I bought last summer seems to have 7.3.10 installed on it.
> Don't know where to look to determine the ARD version.

I should think you only have the Remote Desktop PostgreSQL server
installation if you've installed Remote Desktop. I don't think it's
part of a stock Mac Mini installation though. You didn't happen to
install Remote Desktop, did you? I think it'd be in /Applications if
you do. You can find the version either by inspecting the app using
Get Info (cmd-I) or launching the app and selecting About Remote
Desktop from the Remote Desktop menu.

Michael Glaesemann
grzm seespotcode net



Re: pgsql and Mac OS X

From
Tom Lane
Date:
Michael Glaesemann <grzm@seespotcode.net> writes:
> On May 1, 2007, at 10:11 , Tom Lane wrote:
>> The Mini I bought last summer seems to have 7.3.10 installed on it.
>> Don't know where to look to determine the ARD version.

> I should think you only have the Remote Desktop PostgreSQL server
> installation if you've installed Remote Desktop. I don't think it's
> part of a stock Mac Mini installation though. You didn't happen to
> install Remote Desktop, did you? I think it'd be in /Applications if
> you do. You can find the version either by inspecting the app using
> Get Info (cmd-I) or launching the app and selecting About Remote
> Desktop from the Remote Desktop menu.

I'm quite sure I never intentionally installed Remote Desktop on that
machine; in fact I'm pretty sure what's there is what came in the box
from Apple.  But I don't see Remote Desktop in /Applications, nor indeed
can I find it anywhere on the disk.  Odd.

(None of my older Macs have the built-in PG installation, FWIW.)

            regards, tom lane