I want only the table definitions, not wiews nor functions.

I have a schema named "cvp". I try:

    pg_dump --schema-only -n cvp -t 'cvp.*' --format plain

And I get:

pg_dump: No matching tables were found

I try also without -n cvp or changing -t to -t *.* -t cvp.

I'am using PostgreSQL 11.


I've just tried this:

pg_dump -s -t test.* -d test

It nicely exported all table definitions, as expected. -s is the same as --schema-only.

| improve this answer | |
  • But it also dumps the views. – jjanes Oct 9 '19 at 16:47
  • My problem was other. I put the -t test.* in a variable in windows. Then when I use it wihtout single-quotes it expands to files in the file system. When I use it with single quotes -t 'test.*' it does not works and say me pg_dump: No matching tables were found – Emilio Platzer Oct 9 '19 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.