I’m trying to figure out how to dump only the table definitions, well those and things they need directly, like sequences & types. What I do NOT want are all the millions (not literally
but it feels like it J) of functions we have. Triggers would be all right if I must, as we only have a few of those. I’ve tried various combinations of args to pg_dump, with -s being what I’d like to work, but I still get all the functions. I suppose I could filter it with Perl or Awk, but that could be tricky. In fact, the best my searching could find is to do: pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/' which fails in some interesting ways. I could dump the schema (with functions) then load it into another DB then programmatically drop all the functions before dumping that with pg_dump, but again why should I have to. Is there any Pg tool that gives me just the table defs or am I going to have to write my own? Thanks, Kevin |