pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jacevedo@we-techs.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Date: Thu, 13 May 2021 12:52:59 -0400
Message-ID: <20210513165259.GA13629@alvherre.pgsql> (raw)
In-Reply-To: <17008-85b49d6fe6276a92@postgresql.org>

On 2021-May-13, PG Bug reporting form wrote:

> I'm using pg_dump to dump my database version 12.5 (RDS), pg_dump version
> 12.6  but I have a the following table 
> 
> CREATE TABLE public.projects_historydata
> (
>     id bigint NOT NULL DEFAULT
> nextval('projects_historydata_id_seq'::regclass),
>     value double precision NOT NULL,
>     value_at timestamp with time zone NOT NULL,
>     var_id integer NOT NULL,
>     created timestamp with time zone NOT NULL,
>     CONSTRAINT projects_historydata_pkey PRIMARY KEY (id),
>     CONSTRAINT projects_historydata_var_id_21f99477_fk_projects_var_id
> FOREIGN KEY (var_id)
>         REFERENCES public.projects_var (id) MATCH SIMPLE
>         ON UPDATE NO ACTION
>         ON DELETE NO ACTION
>         DEFERRABLE INITIALLY DEFERRED
> )
> 
> WITH (
>     autovacuum_enabled = TRUE
> )
> TABLESPACE pg_default;

Hello Jaime

How did you get this table definition?

I suggest to run this:
  ALTER SEQUENCE projects_historydata_id_seq OWNED BY public.projects_historydata.id 
and then things will work better.

Cheers

-- 
Álvaro Herrera       Valdivia, Chile





view thread (9+ messages)  latest in thread

Message-ID: <20210513165259.GA13629@alvherre.pgsql>
Permalink:  ../20210513165259.GA13629@alvherre.pgsql/
Also on:    postgresql.org/message-id/20210513165259.GA13629@alvherre.pgsql

 · 

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-bugs@postgresql.org
  Cc: alvherre@alvh.no-ip.org, jacevedo@we-techs.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
  In-Reply-To: <20210513165259.GA13629@alvherre.pgsql>

* 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