Reputation: 44
I use
pg_dump -d xx_sjcbhs --table=wd555.ft_bjgzflcbmxb --column-inserts > e:\temp\ontable2.sql
backup a table. The command is Ok, but the backup file have no insert statement, and no data.
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.5
-- Dumped by pg_dump version 14.5
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
--
-- Name: ft_bjgzflcbmxb; Type: TABLE; Schema: wd555; Owner: postgres
--
CREATE TABLE wd555.ft_bjgzflcbmxb (
xxbsm text NOT NULL,
xxmc text NOT NULL,
tyshxydm text NOT NULL,
id text NOT NULL,
yyyymm text NOT NULL,
bjdm text NOT NULL,
cbflbm text NOT NULL,
cbfl text NOT NULL,
je numeric(18,2) NOT NULL,
zgh text NOT NULL,
rysxdm text NOT NULL,
ftbz text,
ftsm text,
dftje numeric(18,2) NOT NULL,
zrs numeric(18,2) NOT NULL,
bjrs numeric(18,2) NOT NULL
)
PARTITION BY LIST (yyyymm);
--
-- PostgreSQL database dump complete
Upvotes: 1
Views: 636
Reputation: 247575
You got what you requested, because a partitioned table contains no data. You have to dump the partitions as well if you want to dump the data. To makes that easier, note that the --table
option accepts a pattern as argument, so that you don't have to enumerate all partitions.
Upvotes: 2