Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Date
Msg-id CAKFQuwZx+Dfw2V7oGCFWEqpx-zaA2V-aJ=bvK3PM_ARqG2Zozw@mail.gmail.com
Whole thread Raw
In response to BUG #17008: pg_dump doesn't dump a sequence with bigint type  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Thu, May 13, 2021 at 9:04 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17008
Logged by:          Jaime Acevedo
Email address:      jacevedo@we-techs.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.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type