pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Kevin Brannen <KBrannen@efji.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: pg_restore issues with intarray
Date: Fri, 6 Sep 2019 15:39:54 -0700
Message-ID: <0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com> (raw)
In-Reply-To: <DM6PR19MB345141EE667528705B9DCB5CA4BA0@DM6PR19MB3451.namprd19.prod.outlook.com>
References: <DM6PR19MB3451A254F5F813444B387A57A4BB0@DM6PR19MB3451.namprd19.prod.outlook.com>
	<dce484a0-4e4e-a06f-768d-ee611df2a956@aklaver.com>
	<DM6PR19MB3451B3F6A483B8B85D1AEBB2A4BB0@DM6PR19MB3451.namprd19.prod.outlook.com>
	<587d9b02-e4c4-c08e-4b70-169d029bd3e7@aklaver.com>
	<804d3055-b371-d914-7a77-1b9d8cf703cf@aklaver.com>
	<DM6PR19MB34518B1627B7A4E1D641807AA4BA0@DM6PR19MB3451.namprd19.prod.outlook.com>
	<0e059013-15d7-b586-db9f-5ccd653b0689@aklaver.com>
	<DM6PR19MB345141EE667528705B9DCB5CA4BA0@DM6PR19MB3451.namprd19.prod.outlook.com>

On 9/6/19 8:45 AM, Kevin Brannen wrote:
>> From: Adrian Klaver <adrian.klaver@aklaver.com>
>> On 9/5/19 5:05 PM, Kevin Brannen wrote:
>>>
>>> It feels like the restore is adding the intarray extension, which does
>>> a CREATE OPERATOR FAMILY on its own, then later the restore does
>>> CREATE OPERATOR FAMILY on again causing the problem. Yet this doesn't
>>> happen on most of our databases, just a few. It's maddening to me.
>>>
>> What does \dx show in the database you taking the dump from?
> 
> Sadly, I don't have access to that system.
> 
>> What if you do a restore to a file only the schema e.g.:
>>
>> pg_restore -s -f some_file.sql
>>
>> This will create a plain text version of only the schema objects in some_file.sql instead of restoring to the database. It might help shed some light.
> 
> No CREATE EXTENSION or CREATE OPERATOR FAMILY statements.

I do not see that as possible. Something ran CREATE OPERATOR FAMILY:

pg_restore: [archiver (db)] could not execute query: ERROR:  operator 
family "gin__int_ops" for access method "gin" already exists
     Command was: CREATE OPERATOR FAMILY gin__int_ops USING gin;

So either someone opened up template0 and loaded the extension into it 
or the dump file has the CREATE OPERATOR FAMILY in it. Another thought 
search on intarray.

> 
> Jerry's post indicates this is something that just happens with some older
> versions and it seems I got unlucky. I do have a work around (ignore) but
> I'd rather be proactive in knowing I'm ignoring something I should be and
> not ignoring meaningful errors.

We are not dealing with magic here, there is some mechanism at work. 
Dollars to donuts there is an unpackaged version of the extension in one 
or more of the source databases. See below for more information on this:

https://www.postgresql.org/docs/11/extend-extensions.html

38.16.5. Extension Updates

You will need to look at the source databases in situ.


> 
> Thanks for the help Adrian, I really appreciate it!



-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (13+ messages)

Message-ID: <0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com>
Permalink:  ../0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com/
Also on:    postgresql.org/message-id/0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com

 · 

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: adrian.klaver@aklaver.com, KBrannen@efji.com
  Subject: Re: pg_restore issues with intarray
  In-Reply-To: <0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com>
  References: <DM6PR19MB3451A254F5F813444B387A57A4BB0@DM6PR19MB3451.namprd19.prod.outlook.com> <dce484a0-4e4e-a06f-768d-ee611df2a956@aklaver.com> <DM6PR19MB3451B3F6A483B8B85D1AEBB2A4BB0@DM6PR19MB3451.namprd19.prod.outlook.com> <587d9b02-e4c4-c08e-4b70-169d029bd3e7@aklaver.com> <804d3055-b371-d914-7a77-1b9d8cf703cf@aklaver.com> <DM6PR19MB34518B1627B7A4E1D641807AA4BA0@DM6PR19MB3451.namprd19.prod.outlook.com> <0e059013-15d7-b586-db9f-5ccd653b0689@aklaver.com> <DM6PR19MB345141EE667528705B9DCB5CA4BA0@DM6PR19MB3451.namprd19.prod.outlook.com> <0ef348c2-baa1-cbb7-5a8d-2f62c12d16ef@aklaver.com>

* 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