Skip site navigation (1) Skip section navigation (2)

BUG #3048: pg_dump dumps intarray metadata incorrectly

From: "Dmitry Koterov" <d(at)koterov(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3048: pg_dump dumps intarray metadata incorrectly
Date: 2007-02-21 16:20:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3048
Logged by:          Dmitry Koterov
Email address:      d(at)koterov(dot)ru
PostgreSQL version: 8.2.0
Operating system:   Linux
Description:        pg_dump dumps intarray metadata incorrectly

Steps to reproduce:

1. create database ti;
2. <run SQL initialization code for intarray>
3. pg_dump -i -h YourHost -U YourLogin ti > s.sql
4. drop database ti; create database ti;
5. <run SQL produced by pg_dump (s.sql)>

You will get a message:

ERROR:  could not make operator class "gin__int_ops" be default for type
DETAIL:  Operator class "_int4_ops" already is the default.

Seems the problem is in the operator 

    DEFAULT FOR TYPE integer[] USING gin AS
    STORAGE integer ,
    OPERATOR 3 &&(integer[],integer[]) ,
    OPERATOR 6 =(anyarray,anyarray) RECHECK ,
    OPERATOR 7 @>(integer[],integer[]) ,
    OPERATOR 8 <@(integer[],integer[]) RECHECK ,
    OPERATOR 13 @(integer[],integer[]) ,
    OPERATOR 14 ~(integer[],integer[]) RECHECK ,
    OPERATOR 20 @@(integer[],query_int) ,
    FUNCTION 1 btint4cmp(integer,integer) ,
    FUNCTION 2 ginarrayextract(anyarray,internal) ,
    FUNCTION 3 ginint4_queryextract(internal,internal,smallint) ,
    FUNCTION 4 ginint4_consistent(internal,smallint,internal);

produced by pg_dump. This is likely because of the operator

--mark built-in gin's _int4_ops as non default
update pg_opclass set opcdefault = 'f' where
	pg_opclass.opcamid = (select pg_am.oid from pg_am where amname='gin') and
	opcname = '_int4_ops';

inside intarray initialization SQL code: pg_dump knows nothing about them in
the stage of scheme creation.

So, now it is impossible to dump+restore a database containing intarray


pgsql-bugs by date

Next:From: Feng ChenDate: 2007-02-21 19:56:38
Subject: pg_dump and truncate
Previous:From: Zdenek KotalaDate: 2007-02-21 14:28:06
Subject: Re: BUG #2969: Inaccuracies in Solaris FAQ

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group