pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martin Mueller <martinmueller@northwestern.edu>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: two instances of postgres on the same machine?
Date: Sun, 15 Jul 2018 16:16:46 -0400
Message-ID: <31528.1531685806@sss.pgh.pa.us> (raw)
In-Reply-To: <541D3B36-E9C2-4010-BC07-6A134C63C5D4@northwestern.edu>
References: <541D3B36-E9C2-4010-BC07-6A134C63C5D4@northwestern.edu>

Martin Mueller <martinmueller@northwestern.edu> writes:
> I created a dumpfile from a 10.3 postgres installation on a Mac and tried to restore it on another Mac 1,000 miles away, but forgot that that machine runs Postgres 9.6.

OK ...

> The command
> /Applications/Postgres.app/Contents/Versions/9.6/bin/psql -U postgres  earlyprint2 </volumes/"theseus 1"/earlyprint_backup.sq.tar
> generated a long error list  like this:
> ERROR:  syntax error at or near "toc"
> LINE 1: toc.dat    spelling character varying(150) NOT NULL,
>         ^

I gather from the ".tar" filename that you used -Ft dump format; if so,
you need to feed it to pg_restore not plain psql.  The errors you're
showing here look somewhat consistent with the theory that you got that
wrong, although other explanations are certainly possible.

> I can’t tell from the error list whether it’s  a matter of a corrupted
> backup file or (more probably) a result of 9.6 not reading  a 10.3 dump
> file.

While the latter is possible, I think that typically it would only happen
if the 10.x installation is using SQL DDL features that 9.6.x doesn't
have.  I would try doing what you're doing, but with the right process...

> If the latter, what would be the safest way of cleaning up this mess?
> There is a side of me that would prefer installing a 10.3 on the same
> machine in addition, but I’m not sure whether I can do this in the
> environment of the Postgres App. I access the data via Aqua Studio that
> looks for the server on port 5432, which seems to be a standard port.
> Is there a safe way of installing a second server via a different port?

You can certainly install multiple PG servers on one machine; most of the
developers have several different PG versions laying about.  What you need
for that is separate install directories, separate data directories, and
separate port numbers for each server.  This is easy to achieve if
building from source, but may be nigh impossible if you are installing
somebody else's packaging and they didn't make provisions for it.  I don't
know much about the Postgres App packaging so I can't offer any advice
there.  I also don't know how hard it is to get the Aqua client you
mention to talk to a nonstandard port number, though I'd guess that it's
possible.

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <31528.1531685806@sss.pgh.pa.us>
Permalink:  ../31528.1531685806@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31528.1531685806@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, martinmueller@northwestern.edu
  Subject: Re: two instances of postgres on the same machine?
  In-Reply-To: <31528.1531685806@sss.pgh.pa.us>
  References: <541D3B36-E9C2-4010-BC07-6A134C63C5D4@northwestern.edu> <31528.1531685806@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox