pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: " <pgsql-general@postgresql.org>
Subject: pg_dump of partitioned table not working.
Date: Wed, 2 Dec 2020 17:27:36 -0600
Message-ID: <6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com> (raw)

What am I missing?

(Specifying the whole file name because multiple versions are installed.)

$ /usr/lib/postgresql/12/bin/pg_dump --version
pg_dump (PostgreSQL) 12.5 (Ubuntu 12.5-1.pgdg18.04+1)

postgres=# \d+ measurement
                            Partitioned table "public.measurement"
   Column   |  Type   | Collation | Nullable | Default | Storage | Stats 
target | Description
-----------+---------+-----------+----------+---------+---------+--------------+-------------
  city_id   | integer |           | not null |         | plain   
|              |
  logdate   | date    |           | not null |         | plain   
|              |
  peaktemp  | integer |           |          |         | plain   
|              |
  unitsales | integer |           |          |         | plain   
|              |
Partition key: RANGE (logdate)
Indexes:
     "measurement_pkey" PRIMARY KEY, btree (city_id, logdate)
Partitions: measurement_y2019h1 FOR VALUES FROM ('2019-01-01') TO 
('2019-07-01'),
             measurement_y2019h2 FOR VALUES FROM ('2019-07-01') TO 
('2020-01-01'),
             measurement_y2020h1 FOR VALUES FROM ('2020-01-01') TO 
('2020-07-01'),
             measurement_y2020h2 FOR VALUES FROM ('2020-07-01') TO 
('2021-01-01')

postgres=# select * from measurement;
  city_id |  logdate   | peaktemp | unitsales
---------+------------+----------+-----------
        5 | 2019-05-03 |          |
        5 | 2020-11-22 |       77 |        45
        4 | 2020-11-22 |       77 |        45
(3 rows)

$ /usr/lib/postgresql/12/bin/pg_dump -p5433 -d postgres -t measurement 
--data-only
--
-- PostgreSQL database dump
--

-- Dumped from database version 12.5 (Ubuntu 12.5-1.pgdg18.04+1)
-- Dumped by pg_dump version 12.5 (Ubuntu 12.5-1.pgdg18.04+1)

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;

--
-- PostgreSQL database dump complete
--



-- 
Angular momentum makes the world go 'round.





view thread (20+ messages)  latest in thread

Message-ID: <6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com>
Permalink:  ../6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com/
Also on:    postgresql.org/message-id/6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: pg_dump of partitioned table not working.
  In-Reply-To: <6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com>
  References: <6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com>

* 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