From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: CREATE TYPE error in PostgreSQL database!!!!!!
Date: Mon, 3 Jan 2022 16:05:42 +0100
Message-ID: <c2d1f056-67c5-eb93-3904-e7b689bb29c6@jakobs.com> (raw)
In-Reply-To: <DXXP273MB006110F6833EAA25FA39D579F0499@DXXP273MB0061.AREP273.PROD.OUTLOOK.COM>
References: <DXXP273MB006110F6833EAA25FA39D579F0499@DXXP273MB0061.AREP273.PROD.OUTLOOK.COM>
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
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: CREATE TYPE error in PostgreSQL database!!!!!!
In-Reply-To: <c2d1f056-67c5-eb93-3904-e7b689bb29c6@jakobs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox