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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jacevedo(at)we-techs(dot)com
Subject: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Date: 2021-05-13 15:45:00
Message-ID: 17008-85b49d6fe6276a92@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-05-13 16:31:42 Re: BUG #17008: pg_dump doesn't dump a sequence with bigint type
Previous Message Tom Lane 2021-05-13 15:41:24 Re: BUG #17007: server process (PID XXXX) was terminated by signal 11: Segmentation fault