Eric Boisvert
Eric Boisvert

Reputation: 135

pg_dump ignores postgis functions and types

I'm trying to dump the public schema of a database that contains postgis functions and types. The reason why is beyond the question - would be too long to explain why I need to do this.

Anyhow, when I do

pg_dump -d <db> -h  <host>  -U <user> -n public -Fp > public.sql

the file is essentially empty. I checked (tried different servers too) and all functions and types are in there in public scheams. I'm using the right user, etc.. I even tried to create my own function in there and this one only ended up in the output file

Anyone has a clue why ?

thanks.

Upvotes: 1

Views: 481

Answers (1)

jjanes
jjanes

Reputation: 44305

Extensions are dumped "by reference" not by listing all of their components.

The creation of the individual components can be found in the installation script.

vi `pg_config --sharedir`/extension/postgis--3.1.1.sql

But you would have to tweak that to get the proper version.

Upvotes: 3

Related Questions