2

Is it possible to attach metadata to a stored procedure in Postgres 11?

In particular, I have database migrations with version numbers. So when my migration script runs and might override the current stored proc with CREATE OR REPLACE PROCEDURE, I'd like to be able to attach metadata to the stored proc, with the a newer version number.

Also, how can this be queried afterwards?

1 Answer 1

5

For this there is a COMMENT SQL command:

COMMENT ON PROCEDURE whatever IS 'some text'

To retrieve it later use the function obj_description().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.