Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fampL-0003oc-RH for pgsql-general@arkaria.postgresql.org; Wed, 04 Jul 2018 18:48:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fampJ-000559-Ri for pgsql-general@arkaria.postgresql.org; Wed, 04 Jul 2018 18:48:29 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fampJ-000552-Bo for pgsql-general@lists.postgresql.org; Wed, 04 Jul 2018 18:48:29 +0000 Received: from cpanel-web.eurotuxcloud.com ([193.104.52.10]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fampE-0001gw-Ky for pgsql-general@postgresql.org; Wed, 04 Jul 2018 18:48:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=diascosta.org; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KR+tqdKQAXxc9m+pa+E8SkIsOIIyfmcuTH69PuYRMWk=; b=H4utq4d03PDubwiTXjYg2KDY+ D3z7JyyjE6W+ZbulgIm1WQngjmtgp4L45zb3+sUg4iz38XM7HSuiDPsfu0t7aDiBYgVbqucm+qc/o 9GeQ5gx1rFJ5z/29RzSs2CGKIi7ZdGNfkxr7x2bcaBo8SyVuYAiEPts+WGuuFqU0vNvcTgJsdqzw0 ylUj6a6jDWo+ObedblUGeyDLDhq5cME9KV5OMTHbXVSPP6cJVNgMNcIfsrSDzjTqaLHkTbiay0JKk GfbB5Ll+DbMRyGuU7ytS7GY+djWrVPqxPFsQHTD8tKl8o+b9ndXF900oQfuNlrNHVdrhJfPcxQSRN AcU4eo/Sw==; Received: from [62.48.211.140] (port=20192 helo=[10.250.250.1]) by cpanel-web.eurotuxcloud.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1famp9-00046l-CZ; Wed, 04 Jul 2018 19:48:19 +0100 Subject: Re: Cloning schemas To: Melvin Davidson , =?UTF-8?Q?=c5=81ukasz_Jarych?= Cc: Adrian Klaver , "pgsql-general@postgresql.org >> PG-General Mailing List" References: <63460.1530538220@sss.pgh.pa.us> From: DiasCosta Message-ID: Date: Wed, 4 Jul 2018 19:48:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------8394C669AFCEA509B5C680BB" Content-Language: en-GB X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel-web.eurotuxcloud.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - diascosta.org X-Get-Message-Sender-Via: cpanel-web.eurotuxcloud.com: authenticated_id: diascosta@diascosta.org X-Authenticated-Sender: cpanel-web.eurotuxcloud.com: diascosta@diascosta.org X-Source: X-Source-Args: X-Source-Dir: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8394C669AFCEA509B5C680BB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Melvin, I'm new to clone_schema. Can I use it on PostgreSQL 9.6? TIA DCosta On 03-07-2018 14:34, Melvin Davidson wrote: > > > > ERROR: BŁĄD: you cannot add to column "TopoToVersion_ID" DETAIL: > Column "TopoToVersion_ID" is an identity column defined as > GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. > CONTEXT: wyrażenie SQL "INSERT INTO version4.t_topotoversions > SELECT * FROM public.t_topotoversions;" funkcja PL/pgSQL > clone_schema(text,text,boolean), wiersz 212 w EXECUTE > > > Lukasz, > That ERROR is occuring because you choose to copy the data > (include_recs = TRUE). > I have added OVERRIDING SYSTEM VALUE to the insert statement and > attached revised version. > CAUTION: The value of TopoToVersion_ID and any other IDENTITY columns > may be changed. > > The revised version is attached. > -- J. M. Dias Costa Telef. 214026948 Telem. 939307421 Se divulgar esta mensagem por terceiros, por favor: 1. Apague o meu endereço de correio electrónico e o meu nome. 2. Apague também os endereços dos seus amigos antes de distribuir. 3. Enderece como cópia oculta (Cc ou Bcc) para os SEUS destinatários. Agindo deste modo, dificultará a disseminação de "vírus", "spams" e "banners" e contribuirá para manter a privacidade de todos e cada um. Obrigado. Nota: Não se deverá ao acaso a ocorrência de palavras na minha escrita que não respeitem o malfadado acordo ortográfico. --------------8394C669AFCEA509B5C680BB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Hi Melvin,

I'm new to clone_schema.
Can I use it on PostgreSQL 9.6?

TIA
DCosta



On 03-07-2018 14:34, Melvin Davidson wrote:



ERROR: BŁĄD: you cannot add to column "TopoToVersion_ID" DETAIL: Column "TopoToVersion_ID" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. CONTEXT: wyrażenie SQL "INSERT INTO version4.t_topotoversions SELECT * FROM public.t_topotoversions;" funkcja PL/pgSQL clone_schema(text,text,boolean), wiersz 212 w EXECUTE

Lukasz,
That ERROR is occuring because you choose to copy the data (include_recs = TRUE).
I have added OVERRIDING SYSTEM VALUE to the insert statement and attached revised version.
CAUTION: The value of TopoToVersion_ID and any other IDENTITY columns may be changed.

The revised version is attached.


-- 
J. M. Dias Costa
Telef. 214026948     Telem. 939307421

Se divulgar esta mensagem por terceiros, por favor:
1. Apague o meu endereço de correio electrónico e o meu nome.
2. Apague também os endereços dos seus amigos antes de distribuir.
3. Enderece como cópia oculta (Cc ou Bcc) para os SEUS destinatários.
Agindo deste modo, dificultará a disseminação de "vírus", "spams" e
"banners" e contribuirá para manter a privacidade de todos e cada um.
Obrigado.

Nota: Não se deverá ao acaso a ocorrência de palavras na minha escrita que não respeitem o 
malfadado acordo ortográfico.
--------------8394C669AFCEA509B5C680BB--