You can use the pg_dump utility to export the structure of your PostgreSQL database.
To exclude objects created by database extensions like PostGIS, you can use the --exclude-extension option followed by the name of the extension. For example, to exclude all objects created by the PostGIS extension, you can use the following command:
pg_dump --exclude-extension=postgis -U <username> -s <databasename> > <outputfile>
This command will create a SQL script that includes the structure of all tables, functions, etc., created by you, but excludes everything created by the PostGIS extension. The -s option specifies that only the database schema should be exported, without the data.
You can customize the command further by specifying additional options such as the --schema option to include only specific schemas, or the --table option to include only specific tables. You can also pipe the output of pg_dump to a compression utility such as gzip to create a compressed backup file.
public
schema be an option?