pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jacevedo@we-techs.com
Subject: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Date: Thu, 13 May 2021 15:45:00 +0000
Message-ID: <17008-85b49d6fe6276a92@postgresql.org> (raw)

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),
    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;

ALTER TABLE public.projects_historydata
    OWNER to wedbmaster;

GRANT SELECT ON TABLE public.projects_historydata TO read_only_user;

GRANT SELECT ON TABLE public.projects_historydata TO readaccess;

GRANT ALL ON TABLE public.projects_historydata TO wedbmaster;
-- Index: projects_historydata_db9d0193

-- DROP INDEX public.projects_historydata_db9d0193;

CREATE INDEX projects_historydata_db9d0193
    ON public.projects_historydata USING btree
    (var_id ASC NULLS LAST)
    TABLESPACE pg_default;
-- Index: projects_historydata_var_id_value_at_idx

-- DROP INDEX public.projects_historydata_var_id_value_at_idx;

CREATE INDEX projects_historydata_var_id_value_at_idx
    ON public.projects_historydata USING btree
    (var_id ASC NULLS LAST, value_at ASC NULLS LAST)
    TABLESPACE pg_default;

-- Trigger: after_insert_projects_historydata_trigger

-- DROP TRIGGER after_insert_projects_historydata_trigger ON
public.projects_historydata;

CREATE TRIGGER after_insert_projects_historydata_trigger
    AFTER INSERT
    ON public.projects_historydata
    FOR EACH ROW
    EXECUTE FUNCTION public.projects_historydata_delete_master();

-- Trigger: before_insert_projects_historydata_trigger

-- DROP TRIGGER before_insert_projects_historydata_trigger ON
public.projects_historydata;

CREATE TRIGGER before_insert_projects_historydata_trigger
    BEFORE INSERT
    ON public.projects_historydata
    FOR EACH ROW
    EXECUTE FUNCTION public.projects_historydata_insert_child();

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;

ALTER SEQUENCE public.projects_project_id_seq
    OWNER TO wedbmaster;

GRANT SELECT ON SEQUENCE public.projects_project_id_seq TO read_only_user;

GRANT ALL ON SEQUENCE public.projects_project_id_seq TO wedbmaster;

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)

Regards,
Jaime Acevedo E.



view thread (9+ messages)  latest in thread

Message-ID: <17008-85b49d6fe6276a92@postgresql.org>
Permalink:  ../17008-85b49d6fe6276a92@postgresql.org/
Also on:    postgresql.org/message-id/17008-85b49d6fe6276a92@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, jacevedo@we-techs.com
  Subject: Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
  In-Reply-To: <17008-85b49d6fe6276a92@postgresql.org>

* 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