1

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

Sam M
  • 4,136
  • 4
  • 29
  • 42
Hu Man
  • 13
  • 3

1 Answers1

0

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

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263