-2

I have to output the constraint in my PostgreSQL using ESQL/C that I have set before directly with SQL. Below is the constraint I need to print out.

ALTER TABLE p
ADD CONSTRAINT check_name_of_det 
CHECK ((name = 'Screw' AND n_det = 'P6') OR n_det <>'P6');
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
karver35
  • 31
  • 1
  • 7

1 Answers1

1

You can use the pg_get_constraintdef function. The argument is the object ID from pg_constraint.

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