From: | "Evgeny Gridasov" <eugrid(at)fpm(dot)kubsu(dot)ru> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #2588: rename table and dump bug |
Date: | 2006-08-23 15:13:12 |
Message-ID: | 200608231513.k7NFDCoP073450@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 2588
Logged by: Evgeny Gridasov
Email address: eugrid(at)fpm(dot)kubsu(dot)ru
PostgreSQL version: 8.1.4-cvs
Operating system: linux debian
Description: rename table and dump bug
Details:
test=# create table tseq1(id serial);
NOTICE: CREATE TABLE will create implicit sequence "tseq1_id_seq" for
serial column "tseq1.id"
CREATE TABLE
test=# \d tseq1
Table "public.tseq1"
Column | Type | Modifiers
--------+---------+----------------------------------------------------
id | integer | not null default nextval('tseq1_id_seq'::regclass)
test=# alter table tseq1 rename to tseq2;
ALTER TABLE
test=# \d tseq2
Table "public.tseq2"
Column | Type | Modifiers
--------+---------+----------------------------------------------------
id | integer | not null default nextval('tseq1_id_seq'::regclass)
everything is ok.
now let's dump it:
eugene(at)deepcore:~$ pg_dump -t tseq2 -U postgres test
--
-- PostgreSQL database dump
--
SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: tseq2; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE tseq2 (
id serial NOT NULL
);
ALTER TABLE public.tseq2 OWNER TO postgres;
--
-- Name: tseq1_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('tseq2', 'id'),
1, false);
--
-- Data for Name: tseq2; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY tseq2 (id) FROM stdin;
\.
--
-- PostgreSQL database dump complete
--
As you can see, dump contains sequence named tseq2_id_seq, but not
tseq1_id_seq as in real database.
Is it a pg_dump bug or 'ALTER TABLE xxx RENAME TO xxx' does not rename the
corresponding sequences?
From | Date | Subject | |
---|---|---|---|
Next Message | Miguel Pedreño Saura | 2006-08-23 17:05:27 | Problem at install / uninstall postgresql |
Previous Message | Christof.Paal | 2006-08-23 12:31:17 | Transactions from Visual C++ |