How to exclude PL/pgSQL functions in export?

后端 未结 3 988
感情败类
感情败类 2021-01-16 13:00

I use following command to dump some structures from server\' database to be able to create sample of data on my local hard drive.

pg_dump -h myserver.com -U         


        
3条回答
  •  醉酒成梦
    2021-01-16 14:00

    In addition to the answer from Bartosz above, you can use the following sed command to remove e.g. a certain FUNCTION from the list before restoring:

    sed -r -i -e '/FUNCTION public plpgsql_call_handler\(\) postgres/d' /var/backup/${DBNAME}.list 
    

提交回复
热议问题