Avoid useless retrieval of defaults and check constraints in pg_dump -a

Julien Rouhaud <rjuju123@gmail.com>

From: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2020-07-12T05:48:50Z
Lists: pgsql-hackers

Attachments

Hi,

Currently, getTableAttrs() always retrieves info about columns defaults and
check constraints, while this will never be used if --data-only option if used.
This seems like a waste of resources, so here's a patch to skip those parts
when the DDL won't be generated.

Commits

  1. Avoid retrieval of CHECK constraints and DEFAULT exprs in data-only dump