pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Problem with schemas, possibly oids?
Date: Thu, 8 Aug 2019 07:14:06 -0500
Message-ID: <edfcd4d6-2db5-1ee2-f995-f6ac927b3100@gmail.com> (raw)
In-Reply-To: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr>
References: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr>

On 8/8/19 4:04 AM, Arni Kromić wrote:
> 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')

Maybe there's a bug in clone_schema or it's wants some assumptions that you 
aren't fulfilling.

What if you manually execute the contents ofclone_schema to generate DDL and 
then run that DDL?


-- 
Angular momentum makes the world go 'round.





view thread (18+ messages)  latest in thread

Message-ID: <edfcd4d6-2db5-1ee2-f995-f6ac927b3100@gmail.com>
Permalink:  ../edfcd4d6-2db5-1ee2-f995-f6ac927b3100@gmail.com/
Also on:    postgresql.org/message-id/edfcd4d6-2db5-1ee2-f995-f6ac927b3100@gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Problem with schemas, possibly oids?
  In-Reply-To: <edfcd4d6-2db5-1ee2-f995-f6ac927b3100@gmail.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