简体   繁体   中英

Autogenerating SQL code for existing constraints

Can I autogenerate SQL code for existing constraint in postgres and get it like the result of other sql query? Pgadmin can do it (看这张照片), but i need the sql query for constraint by it's name. Thanks in advance

You should use the pg_get_constraintdef function to construct an SQL statement for the constraint definition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM