PostgreSQL: How to create full copy of database schema in same database? How I can copy my public schema into the same database with full table structure, data, functions, fk, pk and etc.
My version of Postgres is 8.4
P.S. I need to copy schema NOT database
There's no simple way to do this in pg_dump/pg_restore itself.  You could try the following if you are able to remove the database temporarily.


Take a dump of your public schema using pg_dump
run "ALTER SCHEMA public RENAME TO public_copy"
Restore your dump of your public schema from step 1 using pg_restore