From: Arni Kromić <Arni.Kromic@Bios-ICT.hr>
To: pgsql-admin@lists.postgresql.org
Subject: Problem with schemas, possibly oids?
Date: Thu, 8 Aug 2019 11:04:10 +0200
Message-ID: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr> (raw)
Hello.
We have some weird errors preventing us from using a postgres database.
Software version is PostgreSQL 11.4. on 64-bit Debian Stretch (9.9),
installed from the upstream apt repo.
We're using the clone_schema function from a postgres mailing list
(converted to a procedure now) to create new schemas from a template,
and so far we have created about 170 schemas that way. Now we have
encountered a problem which prevents us from creating new schemas:
CALL clone_schema('klijent_tpl', 'test-2019')
Although this has worked perfectly until now, the call results in this
error:
> ERROR: relation "test-2019.bc_mob_pr_pnd" does not exist CONTEXT: SQL
> statement "COMMENT ON TRIGGER brisi_stavku ON
> "test-2019".bc_mob_pr_pnd IS 'Briši stavke ponude prije brisanja
> zaglavlja ponude'" PL/pgSQL function clone_schema(text,text,boolean)
> line 444 at EXECUTE SQL state: 42P01
Just to note that "test-2019" schema doesn't exist, ant the template
schema "klijent_tpl" contains NO relation named bc_mob_pr_pnd nor the
trigger mentioned in the error message. I see that as a clue it
references the wrong schema, obviously one of the existing schemas
which DO contain a table named bc_mob_pr_pnd and a trigger.
Moreover, trying to clone some of the existing schemas also fails:
call clone_schema ('HR16101766338-2018', 'test')
> NOTICE: source schema HR16101766338-2018 does not exist!
The source schema DOES exist.
There are other weird errors that have started happening. For example,
if I try any select query from within the PGAdmin4 Query Tool, there is
no Data Output, and I get only 'table_oid' (together with single quotes)
in the Messages pane (although View/Edit from the context menu on a
table works, so do the queries from psql shell). This has also worked
fine before.
Another error happens if I try to backup (from PGAdmin4 too). The
command it generates is:
> /usr/bin/pg_dump --file
> "/var/lib/pgadmin/storage/postgres_hostname.domain.tld/test" --host
> "/var/run/postgresql" --port "5432" --username "postgres"
> --no-password --verbose --format=c --blobs --schema
> "HR00000000001-2019" "nubes-test"
It fails with:
>
> 1. pg_dump: last built-in OID is 16383
> 2. pg_dump: no matching schemas were found
>
I'm not actually sure if this has something to do with the other
problems, for I've already seen pg_dump fail just because of the schema
name. However, since OID is mentioned, I'd say it may have something to
do with this.
As I understand, every database object name is mapped to its OID, so it
seems likely to me that mentioned problems where objects are referenced
by name and mysteriously found nonexistent, would have something to do
with OIDs...? Especially since OIDs are explicitly mentioned in some of
the error messages. However, I have no clue how to fix this.
I have VACUUMed and REINDEXed the database for a good measure, but
nothing has changed.
Could someone help with this, please? TIA
--
Kind regards
-----------------------------------------------
Arni Kromić
[ IT system engineer ]
arni.kromic@bios-ict.hr
Tel: +385 21 490 599
Mob: +385 95 659 5 659
----------------------------------------------
Mažuranićevo šet. 14
21000 Split, Croatia
Tel: +385 21 344 349
Fax: +358 21 490 599
http://podrska.bios-ict.hrhttp://www.bios-ict.hr
----------------------------------------------
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-admin@postgresql.org
Cc: Arni.Kromic@Bios-ICT.hr
Subject: Re: Problem with schemas, possibly oids?
In-Reply-To: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr>
References: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr>
* 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