Hi I was trying to create Type but getting a Syntax error while doing it.
CREATE OR REPLACE TYPE ARR_HNW_ID AS VARRAY(50) OF INTEGER;
Can you please help me to resolve this Issue
CodePudding user response:
I don’t believe OR REPLACE is valid syntax. You can CREATE or ALTER types but not REPLACE
CodePudding user response:
Thera are multiple mistakes in your SQL:
- There is no CREATE OR REPLACE TYPE syntax in PostgreSQL- take a look into docs;
- There is no type VARRAY in postgresql. If you need an array of integer just declare it like integer[].
- What you are creating here is not a type but a DOMAIN.
So basically you can simply use integer[] for your ARR_HNW_ID