Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4OuC-0000Zg-Tf for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jan 2022 15:05:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4OuB-0006Ev-Pl for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jan 2022 15:05:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4OuB-0006Em-FH for pgsql-admin@lists.postgresql.org; Mon, 03 Jan 2022 15:05:47 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4Ou8-0003rL-S0 for pgsql-admin@lists.postgresql.org; Mon, 03 Jan 2022 15:05:47 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id 70728380722; Mon, 3 Jan 2022 16:05:43 +0100 (CET) Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id f6GwSj7yWj3X; Mon, 3 Jan 2022 16:05:43 +0100 (CET) Received: from [192.168.178.197] (ip-37-201-154-229.hsi13.unitymediagroup.de [37.201.154.229]) by rs.plausibolo.de (Postfix) with ESMTPSA id 1ACBC3806ED; Mon, 3 Jan 2022 16:05:43 +0100 (CET) Message-ID: Date: Mon, 3 Jan 2022 16:05:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Content-Language: de-DE To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Subject: Re: CREATE TYPE error in PostgreSQL database!!!!!! In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------mD8ylfMPUaLtknw7Anvmy0Iy" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------mD8ylfMPUaLtknw7Anvmy0Iy Content-Type: multipart/mixed; boundary="------------RoNin32a0LhnxOrfQO4dVsfs"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: Subject: Re: CREATE TYPE error in PostgreSQL database!!!!!! References: In-Reply-To: --------------RoNin32a0LhnxOrfQO4dVsfs Content-Type: multipart/alternative; boundary="------------ZT3LZqUcIWj5kBaLmA39kzkx" --------------ZT3LZqUcIWj5kBaLmA39kzkx Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMDMuMDEuMjIgdW0gMDg6NDAgc2NocmllYiBBc2hvayBLdW1hciBNYW5pOg0KPiBIaSBU ZWFtDQo+IFdoaWxlIGNyZWF0aW5nIGZ1bmN0aW9uIEkgaGF2ZSBlbmNvdW50ZXJlZCB0aGUg YmVsb3cgZXJyb3IgaW4gDQo+IFBvc3RncmVTUUwgZGF0YWJhc2UuDQo+IEkgbmVlZCB0byBr bm93IGhvdyB0byB1c2UgdGhlICphcnJheSBkZWNsYXJhdGlvbiBpbiBUeXBlIGRhdGF0eXBl IGluIA0KPiBwb3N0Z3JlU1FMIGRhdGFiYXNlLiBDb3VsZCB5b3UgcGxlYXNlIGhlbHAgb3Ig c2hhcmUgc29tZSBleG1wbGUgdG8gdXNlIA0KPiBpdD8gKg0KPg0KPiAgMS4gKk5lZWQgdG8g Y3JlYXRlIHR5cGUgKg0KPiAgMi4gKkRlY2xhcmUgYXJyYXkgdmFyaWFibGUgaW4gdHlwZSBk YXRhdHlwZS4gKg0KPg0KPiBFUlJPUjogc3ludGF4IGVycm9yIGF0IG9yIG5lYXIgImNfZGJf ZmllbGR2YWx1ZXMiIExJTkUgMTEzOiAuLi4gZmV0Y2ggDQo+IHVzYWdlX2N1cnNvciBpbnRv IGNfZGJfZmllbGR2YWx1ZXMgY19kYl9maWVsZC4uLiBeIFNRTCBzdGF0ZTogNDI2MDEgDQo+ IENoYXJhY3RlcjogOTQ0Nw0KPiBUaGFua3MgJiBCZXN0IFdpc2hlcywNCj4gQXNob2sNCg0K V2hhdCBoYXZlIHlvdSB0cmllZD8gQWxsIHR5cGVzIGluIFBvc3RncmVTUUwgY2FuIGFsc28g YmUgdXNlZCBhcyBhcnJheXMuIA0KUHV0IGVtcHR5IGJyYWNrZXRzIGFmdGVyIHRoZSB0eXBl IGFuIGl0J3MgYSBvbmUtZGltZW5zaW9uYWwgYXJyYXkuIFB1dCANCnR3byBwYWlycyBvZiBl bXB0eSBicmFja2V0cyBhZnRlciB0aGUgdHlwZSBhbmQgaXQncyBhIHR3by1kaW1lbnNpb25h bCBhcnJheS4NCg0KVGhlcmUgaXMgbm8gbmVlZCB0byBleHBsaWNpdGx5IGNyZWF0ZSBhbiBh cnJheSB0eXBlLg0KDQpzZWUgaHR0cHM6Ly93d3cucG9zdGdyZXNxbC5vcmcvZG9jcy9jdXJy ZW50L2FycmF5cy5odG1sDQoNCg0KLS0gDQpIb2xnZXIgSmFrb2JzLCBCZXJnaXNjaCBHbGFk YmFjaCwgVGVsLiArNDktMTc4LTk3NTkwMTINCg0K --------------ZT3LZqUcIWj5kBaLmA39kzkx Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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.<= /div>
=C2=A0
I need to know how to use the a= rray declaration in Type datatype in postgreSQL database. Could you please help or share some exmple to use it?
=C2=A0
  1. Need to create type
  2. Declare array variable in type datatype.
=C2=A0
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
=C2=A0
Thanks & Best Wishes,
Ashok
=C2=A0

What have y= ou 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


--=20
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
--------------ZT3LZqUcIWj5kBaLmA39kzkx-- --------------RoNin32a0LhnxOrfQO4dVsfs-- --------------mD8ylfMPUaLtknw7Anvmy0Iy Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCYdMQxgUDAAAAAAAKCRCKV5yTsxlhug/5 AJwJUSPREMmpV3AW9hl6OCNVLejiBgCghighzoFgvjYHgYj9RIAnZlWJLus= =weAF -----END PGP SIGNATURE----- --------------mD8ylfMPUaLtknw7Anvmy0Iy--