My idea is to make a backup of a database with many of its own functions, types and its own schema, to be able to save it in sql format and use it as an extension to install it on another computer.
Since I already have tables, but I am not interested in exporting them, I would like to know if there is any option (I have tried several options pg_dump
but I can't find the key) to do what I want.
Thank you
Your question is answered elsewhere in the forum: How can I export the schema of a database in PostgreSQL?
On Linux use this command:
If you are using Windows you can use this other one:
For any other case you should go through the PostreSQL documentation - pg_dump
I think I have found the most acceptable solution.
1.- Make a dump of the database:
2.- List the content to a file filtering by keyword. In my case it is enough for me with the functions and the proper types (FUNCTION and TYPE)
3.- With the previously created file we use the -L option to restore only the elements listed in the previous file
listado
seen here and here