user2608493
user2608493

Reputation: 1

How to alter type in pgsql?

I'm trying to add an attribute to an existing TYPE named student_info. When I execute the query in pgAdmin I get an error. How can I fix this?

This is my query:

ALTER TYPE student_info ADD ATTRIBUTE intake_date DATE;

This is the error:

ERROR:  syntax error at or near "ADD"
LINE 1: ALTER TYPE student_info ADD ATTRIBUTE intake_date DATE;
                            ^

********** Error **********

ERROR: syntax error at or near "ADD"
SQL state: 42601
Character: 25

Upvotes: 0

Views: 1531

Answers (1)

Daniel Vérité
Daniel Vérité

Reputation: 61546

Presumably you're using PostgreSQL 9.0 or older that doesn't offer the possibility to add or drop attributes. It was added in 9.1

See ALTER TYPE in the documentation for your version.

Upvotes: 1

Related Questions