How to backup a table having a capitalized table name with quotes using pg_dump
search cancel

How to backup a table having a capitalized table name with quotes using pg_dump

book

Article ID: 296376

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

For example, we created a table with capitalized name and quotes:
postgres=# create table "TEST111"(id int);
CREATE TABLE

All of the backup commands below will get failed due to "table not found":
pg_dump -t public.TEST111 -d postgres
pg_dump -t 'public.TEST111' -d postgres
pg_dump -t "public.TEST111" -d postgres
pg_dump -t public."TEST111" -d postgres


Environment

Product Version: 11.5

Resolution

The solution is to put single quotes around the full name of this table:
pg_dump -t 'public."TEST111"' -d postgres