Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: jacevedo(at)we-techs(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Date: 2021-05-13 16:31:42
Message-ID: CAKFQuwZx+Dfw2V7oGCFWEqpx-zaA2V-aJ=bvK3PM_ARqG2Zozw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 13, 2021 at 9:04 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17008
> Logged by: Jaime Acevedo
> Email address: jacevedo(at)we-techs(dot)com
> PostgreSQL version: 12.6
> Operating system: ubuntu 20.04
> Description:
>
> 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),
> [...]
> this table make references to the sequence projects_historydata_id_seq
> -- SEQUENCE: public.projects_project_id_seq
>
> -- DROP SEQUENCE public.projects_project_id_seq;
>
> CREATE SEQUENCE public.projects_project_id_seq
> INCREMENT 1
> START 1
> MINVALUE 1
> MAXVALUE 9223372036854775807
> CACHE 1;
> [...]
>
> At the moment to do a pg_dump the pg_dump doesn't make the script for the
> sequence, then the restore fail to create the table.
>
> Please see that the id value for the table (the value handle by the
> sequences is not an integer is biginteger)
>
>
I'm confused regarding the complaint. I see that the sequence used by the
history table is different from the single sequence shown in the email. Is
the script in the email the entire dump script? What dump command did you
use?

The sequence you show is a bigint sequence since that is the default and
there is nothing overriding it. Though since you seem to be showing
mis-matched information that observation is only a general one.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2021-05-13 16:52:59 Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Previous Message PG Bug reporting form 2021-05-13 15:45:00 BUG #17008: pg_dump doesn't dump a sequence with bigint type