Skip to main content
Question

How to rename constraints

  • May 2, 2023
  • 1 reply
  • 2 views

joergschaber
Forum|alt.badge.img+2

Hi,
is there a more simple or elegant way to rename table-contraints other than dropping and adding again?

1 reply

marcothesane
Forum|alt.badge.img+1
  • Participating Frequently
  • May 2, 2023

if there were any ways to achieve that, @joergschaber, it would be an ALTER CONSTRAINT command. I tried both searching the docu and by firing this command:

marco ~/1/Vertica/supp $ vsql -c "ALTER CONSTRAINT l_c_pk RENAME TO pk-l_c"
ERROR 4856:  Syntax error at or near "CONSTRAINT" at character 7
LINE 1: ALTER CONSTRAINT l_c_pk RENAME TO pk-l_c