1

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

enter image description here

2 Answers 2

1

I don’t believe OR REPLACE is valid syntax. You can CREATE or ALTER types but not REPLACE

Sign up to request clarification or add additional context in comments.

1 Comment

I have tried with CREATE TYPE ARR_HNW_ID AS VARRAY(50) OF INTEGER; Also but getting same error. Can you pls try ?
1

Thera are multiple mistakes in your SQL:

  1. There is no CREATE OR REPLACE TYPE syntax in PostgreSQL- take a look into docs;
  2. There is no type VARRAY in postgresql. If you need an array of integer just declare it like integer[].
  3. What you are creating here is not a type but a DOMAIN.

So basically you can simply use integer[] for your ARR_HNW_ID

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.