Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvhJ7-0005mC-EH for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2019 12:14:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvhJ6-00050D-8m for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2019 12:14:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvhJ5-0004zt-Uk for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2019 12:14:11 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvhJ3-0001xh-TX for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2019 12:14:11 +0000 Received: by mail-ot1-x343.google.com with SMTP id x21so24327509otq.12 for ; Thu, 08 Aug 2019 05:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=htVRj2RKqOXLxLuUHOLj1l6RoPbcJDm4a6DSkrmDBFU=; b=SNLRs0xYqtP+8hdugFPmE1auMEspS8Zro3HVNTP2L05mv5KjucLlLFSS/kFpYwAXe4 d6Vtqj/DH6wvTyuVltGz6wV1lYZhjIn4QmKcgVWSfZGqzVtPh9auRyZcIrULaV4YdrOz KncS1ut0fd+AjkyceXNUTQYmQNTP6VeEVoPbd4c7jAVgDVDdxjk5gxOBVEKvOwMZrVp0 HWHPTIOaCHHspFhCI5MVVeo/KmR/lycDyVJ7/ZWZXNwmnBSieFOzW01sid16hl/ZMsNo 1bTXAGvEen2pQUJJdMW7yHmIQSgmubwmpJjDyZcvK/89429CjAYrgXr0L8z4BbIyAyaX 06XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=htVRj2RKqOXLxLuUHOLj1l6RoPbcJDm4a6DSkrmDBFU=; b=lqE+YJTend3jN+YUR/JrTi9Bxr+KRRPFcbR4mF/KsVPGIktfAxHEy/CJcoumW+2WFG +eADuNvgcoSEyl7RdqhdfHUU/ItvIkMrYmwX1nuU+J/8fT04HiD7xPV1TanojQVUjtx9 w/WWsURm9TDuKeS9IqRYTfOoQF2FC1vZ+PzIWY0LhEX9tKmdMNl9lbpGVejUUNJb+aeP NYxNyuHzC38ntRRZPewIJ9K3G9XH5VuZ0jIy2P4X5sR2EHKP0KB12HZLom9ZF3WpAdVE togV3jlMgN/eOZo1ayQ1uipKAg8h0IBnxbWZnkbrbHhuUPXxSZxYIVGo17Fy3RO8OEGT 2Grw== X-Gm-Message-State: APjAAAWRSEf40EGH9U924EXTmF2n8CmrXczHi3635qrw6+camxNQW6bw cbsLobLdio7MgOi6n/7UZn6BbIIkPVk= X-Google-Smtp-Source: APXvYqx0BZ/FBE4p1usBoLp/8OyzgSx3sSojy5aRyoNLNIRi8pQh6FxzqgMII36GiUX/llilfRtOeA== X-Received: by 2002:a9d:64ca:: with SMTP id n10mr11617015otl.249.1565266448150; Thu, 08 Aug 2019 05:14:08 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id o18sm36084882ote.63.2019.08.08.05.14.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 05:14:07 -0700 (PDT) Subject: Re: Problem with schemas, possibly oids? To: pgsql-admin@lists.postgresql.org References: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr> From: Ron Message-ID: Date: Thu, 8 Aug 2019 07:14:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <3cabefc3-0713-7f5d-27c5-c0dab55cd8c6@Bios-ICT.hr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.