pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: michael.enke@wincor-nixdorf.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8307: can reproduce: pg_dump: schema with OID xxxxxx does not exist
Date: Wed, 17 Jul 2013 14:37:29 +0000
Message-ID: <E1UzSrB-0006E6-M4@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8307
Logged by:          Michael Enke
Email address:      michael.enke@wincor-nixdorf.com
PostgreSQL version: 9.1.8
Operating system:   Linux/CentOS 6.2
Description:        

Hi,
after hitting the above error and found that this is a long lasting one
which nobody knows how to reproduce, I found a way to reproduce it:
In one session create tables in a schema,
in another session drop that schema.


Here comes my test script:


#!/bin/sh


DB=testdb # change if you need
NUM=2000 # adjust so that creation takes enough time to issue drop schema


CREATE=/tmp/$DB.sql
START=/tmp/testdb.start
END=/tmp/testdb.end


LANG=C
rm -f $START $END
>$CREATE
for I in $(seq $NUM); do
  echo "create table t$I(at text, bt text, ct text, dt text);" >> $CREATE
  echo "create table tt$I as select g1.*, t$I.* from g1, t$I where 1=2;" >>
$CREATE
  echo "drop table t$I;" >> $CREATE
done


(
  psql -U postgres -d template1 <<!
    \set ON_ERROR_STOP
    drop database $DB;
    create database $DB;
    \connect $DB
    create schema testschema;
    set search_path = testschema,"\$user",public;
    create table g1(ag text, bg text, cg text, dg text);
    \echo now create $NUM tables
    \o $START
    \o /dev/null
    \i $CREATE
    \o $END
!
  rm -f $CREATE
  sleep 2
  pg_dump -U postgres $DB > testdb.dump
)&


while [ ! -f $START ]; do usleep 100000; done
sleep 1
psql -U postgres -d $DB -c "drop schema testschema cascade" 2>&1 | grep
"^NOTICE"
if [ -f $END ]; then
  echo "too late"
fi
wait
rm -f $START $END


# end script


There are 3 possible errors reported (I executed 10x):
1: Deadlock detected: 1x
2: Could not open relation for Create: 4x
3: cache lookup failed: 5x


In case of 2 or 3 pg_dump reports above error.


If I modify the creation to only one line:
echo "create table tt$I as select g1.* from g1 where 1=2;" >> $CREATE
then in 100% I get the case number 2.


Hope it helps tracking down the reason.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)  latest in thread

Message-ID: <E1UzSrB-0006E6-M4@wrigleys.postgresql.org>
Permalink:  ../E1UzSrB-0006E6-M4@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1UzSrB-0006E6-M4@wrigleys.postgresql.org

 · 

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-bugs@postgresql.org
  Cc: michael.enke@wincor-nixdorf.com
  Subject: Re: BUG #8307: can reproduce: pg_dump: schema with OID xxxxxx does not exist
  In-Reply-To: <E1UzSrB-0006E6-M4@wrigleys.postgresql.org>
  References: <E1UzSrB-0006E6-M4@wrigleys.postgresql.org>

* 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