Re: Problems with pg_upgrade after change of unix user running db. - Mailing list pgsql-general

From Benedikt Grundmann
Subject Re: Problems with pg_upgrade after change of unix user running db.
Date
Msg-id CADbMkNPx1ANyHO54cKkmeFf8LCRHWgugxpD69yyQJGyUSPmRCA@mail.gmail.com
Whole thread Raw
In response to Re: Problems with pg_upgrade after change of unix user running db.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Problems with pg_upgrade after change of unix user running db.
List pgsql-general
On 3 October 2016 at 14:12, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Benedikt Grundmann <bgrundmann@janestreet.com> writes:
> I just tried this again.  This time from 9.2.17 to 9.5.4 and pg_upgrade
> chokes with this:
>
> [root@igm-dbc-001 upgrade-logs]# tail pg_upgrade_dump_16416.log
> pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error
> at or near "=>"
> LINE 1: CREATE OPERATOR => (
>                         ^
>     Command was: CREATE OPERATOR => (
>     PROCEDURE = "tconvert",
>     LEFTARG = "text",
>     RIGHTARG = "text"
> );

You're going to need to manually drop that operator from the source
database, as "=>" isn't a legal operator name anymore.  This appears
to be left over from a pre-9.0 version of hstore.

                        regards, tom lane

Thanks for the quick reply.  How do I do that however?  Without dropping the extension itself that is:

postgres=# select * from pg_operator where oprname = '=>';
(0 rows)
postgres=# \c proddb_testing
psql (9.5.4, server 9.2.17)
You are now connected to database "proddb_testing" as user "as-proddb".
proddb_testing=# select * from pg_operator where oprname = '=>';
-[ RECORD 1 ]+---------
oprname      | =>
oprnamespace | 2200
oprowner     | 10
oprkind      | b
oprcanmerge  | f
oprcanhash   | f
oprleft      | 25
oprright     | 25
oprresult    | 144920
oprcom       | 0
oprnegate    | 0
oprcode      | tconvert
oprrest      | -
oprjoin      | -

proddb_testing=# drop operator => (text, text);
ERROR:  cannot drop operator =>(text,text) because extension hstore requires it
HINT:  You can drop extension hstore instead.

Is it possible that I need to do some form of hstore extension upgrade dance?

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [ANNOUNCE] pgAdmin 4 v1.0 Released!
Next
From: Tom Lane
Date:
Subject: Re: Problems with pg_upgrade after change of unix user running db.