| From: | Holger Jakobs <holger(at)jakobs(dot)com> | 
|---|---|
| To: | pgsql-admin(at)lists(dot)postgresql(dot)org | 
| Subject: | Re: CREATE TYPE error in PostgreSQL database!!!!!! | 
| Date: | 2022-01-03 15:05:42 | 
| Message-ID: | c2d1f056-67c5-eb93-3904-e7b689bb29c6@jakobs.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-admin | 
Am 03.01.22 um 08:40 schrieb Ashok Kumar Mani:
> Hi Team
> While creating function I have encountered the below error in 
> PostgreSQL database.
> I need to know how to use the *array declaration in Type datatype in 
> postgreSQL database. Could you please help or share some exmple to use 
> it? *
>
>  1. *Need to create type *
>  2. *Declare array variable in type datatype. *
>
> ERROR: syntax error at or near "c_db_fieldvalues" LINE 113: ... fetch 
> usage_cursor into c_db_fieldvalues c_db_field... ^ SQL state: 42601 
> Character: 9447
> Thanks & Best Wishes,
> Ashok
What have you tried? All types in PostgreSQL can also be used as arrays. 
Put empty brackets after the type an it's a one-dimensional array. Put 
two pairs of empty brackets after the type and it's a two-dimensional array.
There is no need to explicitly create an array type.
see https://www.postgresql.org/docs/current/arrays.html
-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
| From | Date | Subject | |
|---|---|---|---|
| Next Message | ldh@laurent-hasson.com | 2022-01-03 21:33:27 | RE: CREATE TYPE error in PostgreSQL database!!!!!! | 
| Previous Message | Ashok Kumar Mani | 2022-01-03 07:40:21 | CREATE TYPE error in PostgreSQL database!!!!!! |