pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Łukasz Jarych <jaryszek@gmail.com>
To: tgl@sss.pgh.pa.us
To: pgsql-general@postgresql.org >> PG-General Mailing List <pgsql-general@postgresql.org>
To: vnoagbodji@amplify-nation.com
Subject: Re: Cloning schemas
Date: Mon, 2 Jul 2018 07:03:00 -0700
Message-ID: <c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.com> (raw)
In-Reply-To: <CAGv31od+cuXFttW4FmVGPBJBvjbNBpwgeuhNKfDmqLGqyQMY-Q@mail.gmail.com>
References: <CAGv31ofHAE49iTQ4_Q_AiTduoVscQWXKfZanYU0yQP8HyxPJvQ@mail.gmail.com>
	<63460.1530538220@sss.pgh.pa.us>
	<CAGv31od+cuXFttW4FmVGPBJBvjbNBpwgeuhNKfDmqLGqyQMY-Q@mail.gmail.com>

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 <tgl@sss.pgh.pa.us 
> <mailto:tgl@sss.pgh.pa.us>> napisał(a):
> 
>     =?UTF-8?Q?=C5=81ukasz_Jarych?= <jaryszek@gmail.com
>     <mailto:jaryszek@gmail.com>> 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




view thread (35+ messages)  latest in thread

Message-ID: <c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.com>
Permalink:  ../c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.com/
Also on:    postgresql.org/message-id/c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.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 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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, jaryszek@gmail.com, tgl@sss.pgh.pa.us, vnoagbodji@amplify-nation.com
  Subject: Re: Cloning schemas
  In-Reply-To: <c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.com>
  References: <CAGv31ofHAE49iTQ4_Q_AiTduoVscQWXKfZanYU0yQP8HyxPJvQ@mail.gmail.com> <63460.1530538220@sss.pgh.pa.us> <CAGv31od+cuXFttW4FmVGPBJBvjbNBpwgeuhNKfDmqLGqyQMY-Q@mail.gmail.com> <c941ac40-83cb-9d7b-e0f5-82f48f98cd95@aklaver.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