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 1fZzQD-0004BU-LO for pgsql-general@arkaria.postgresql.org; Mon, 02 Jul 2018 14:03:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fZzQB-0006AX-IY for pgsql-general@arkaria.postgresql.org; Mon, 02 Jul 2018 14:03:15 +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 1fZzQA-0006AQ-B1 for pgsql-general@lists.postgresql.org; Mon, 02 Jul 2018 14:03:15 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fZzQ2-0004QE-HI for pgsql-general@postgresql.org; Mon, 02 Jul 2018 14:03:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7346C21DE0; Mon, 2 Jul 2018 10:03:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 02 Jul 2018 10:03:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=DjT6EgCimDCnWlOYlS84uvE6fDshD JJFDtJhGPtGXHA=; b=IFjw6CVO0/H4HtKlA/BxBlTpB9BbKnE32VCg53x7jKaoN 98VyZNB4IMC3gmJQxra8m1aJLBiWPW5GKrCgQYW0Dcj0Y95kISPzFAeXhe3YAF1d seko7gYoZJAyCMVlS5YStxijVUR99wJk1UGN1LFSVZDR404NFY6R6NQ59KYRNr79 uKP/7ECxpuSnyigT/n6LNRsq5T5qF91NGKZZkPZtlhlAqZm7J5NMXZpaf+hXAK0A z7jreuEL0SoTL74k3thpAn5TsgSZYMI4vjDjPGz7oo47xIrVWdEKFb6SKmOhlExB sMIqHE1b9FSu10kFqSmtzXNj9w8JQ+97lZCb7exQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=DjT6Eg CimDCnWlOYlS84uvE6fDshDJJFDtJhGPtGXHA=; b=oIk4vfLGUYCRYBbrXXs1W9 k8IC4QuWET1gyEO/UBAlUtrxt1wchzjmWGGumqmhs43X7p0zD3jiGLh+8vhscbER HLY/UsGSjWu+GaJPewUevPtEziQY5l7FduvTK747tO5BZbLjz9xO44udzfxqZCQK EUt9tw+d0AQWuvU7mws2MGE2MFTV4iFJSO3vj7qAZgtZfMIoVDVhvKnt8mgGLQE3 buAzO3r1nJVhll1SSxVW7oTzVBPsZaRPCur2RrXxcSPAAxN0nbju7mudQYnwrlFV flm02l7bGoeCi/QkGDm5/xjjXuEAHbsHhi+w3bYrLllZgorh/GjdMU3+4KlBgsyA == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id CAA69102CA; Mon, 2 Jul 2018 10:03:01 -0400 (EDT) Subject: Re: Cloning schemas To: =?UTF-8?Q?=c5=81ukasz_Jarych?= , tgl@sss.pgh.pa.us, "pgsql-general@postgresql.org >> PG-General Mailing List" , vnoagbodji@amplify-nation.com References: <63460.1530538220@sss.pgh.pa.us> From: Adrian Klaver Message-ID: Date: Mon, 2 Jul 2018 07:03:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/02/2018 06:57 AM, Łukasz Jarych wrote: > Hi, > > " > Strange. "audit_sq" looks like an invalid sequence table. I went > here,https://www.postgresql.org/docs/9.6/static/sql-createsequence.html, > and checked all the way back to version 7.1 and "maxvalue" has been a > column since back then. What version of Postgres are you actually doing the cloning in? Per Tom's post: https://www.postgresql.org/docs/10/static/release-10.html " Move sequences' metadata fields into a new pg_sequence system catalog (Peter Eisentraut) ... A sequence relation now stores only the fields that can be modified by nextval(), that is last_value, log_cnt, and is_called. ... The main incompatibility introduced by this change is that selecting from a sequence relation now returns only the three fields named above. To obtain the sequence's other properties, applications must look into pg_sequence. The new system view pg_sequences can also be used for this purpose; it provides column names that are more compatible with existing code. " > > Maybe skip that table for now? It even says the last value is 1. You > should also check the other sequence tables. You can get them by doing: > > select * from information_schema.sequences;" > > Result of select: > > image.png > > Are you sure that I can skip " audit_sq" seq? > > I wrote here because i am newbie and i can not update this. Hope for > your help Guys. > > Best, > Jacek > > > > > > > > pon., 2 lip 2018 o 15:30 Tom Lane > napisał(a): > > =?UTF-8?Q?=C5=81ukasz_Jarych?= > writes: > > I am trying to use : > > > "select * from clone_schema('public','Version8',true) but i am > getting > > error: > > > "Column "max_value" does not exist. > > LINE 1: SELECT last_value, max_value, start_value, increment_by, > min... > > HINT: Maybe you wanted to point to column " "audit_sq.last_value"? > > QUERY: SELECT last_value, max_value, start_value, increment_by, > min_value, > > cache_value, log_cnt, is_cycled, is_called FROM public.audit_sq; > > CONTEXT: function PL/pgSQL clone_schema(text,text,boolean), row 66 in > > EXECUTE > > I guess audit_sq is a sequence?  It looks to me like this function has > not been taught about the changes in sequence metadata in PG v10. > You need to update it, or talk to its author about an update. > >                         regards, tom lane > -- Adrian Klaver adrian.klaver@aklaver.com