X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 31EDE9DC996 for ; Thu, 29 Dec 2005 13:46:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63774-10 for ; Thu, 29 Dec 2005 13:46:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from anu.ie (mail.anu.net [213.247.49.236]) by postgresql.org (Postfix) with ESMTP id 650309DC840 for ; Thu, 29 Dec 2005 13:46:51 -0400 (AST) Received: from kenxp (68.40.184.254) by anu.ie with ESMTP (Eudora Internet Mail Server X 3.2.8b1) for ; Thu, 29 Dec 2005 17:46:50 +0000 From: "Ken Winter" To: "PostgreSQL pg-sql list" Subject: Arrays in PL/pgSQL routines? Date: Thu, 29 Dec 2005 12:46:28 -0500 Message-ID: <005101c60c9f$cfb5f660$6603a8c0@kenxp> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0052_01C60C75.E6DFEE60" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.046 required=5 tests=[AWL=0.045, HTML_MESSAGE=0.001] X-Spam-Score: 0.046 X-Spam-Level: X-Archive-Number: 200512/240 X-Sequence-Number: 23782 This is a multi-part message in MIME format. ------=_NextPart_000_0052_01C60C75.E6DFEE60 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can arrays be declared in PL/pgSQL routines? If so, how? =20 Section 8.10 of the documentation (http://www.postgresql.org/docs/7.4/static/arrays.html) tells how to = declare and use arrays as table columns. But I don't find any part of the documentation that says how to declare a simple array local to a = PL/pgSQL function. I tried the following guess, but it only won me a "syntax = error at or near VARCHAR: =20 DECLARE my_array VARCHAR []; . =20 ~ TIA ~ Ken ------=_NextPart_000_0052_01C60C75.E6DFEE60 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Can arrays be declared in PL/pgSQL routines?  = If so, how?

 

Section 8.10 of the documentation (http://www= .postgresql.org/docs/7.4/static/arrays.html) tells how to declare and use arrays as table columns.  But I = don’t find any part of the documentation that says how to declare a simple = array local to a PL/pgSQL function.  I tried the following guess, but it = only won me a “syntax error at or near VARCHAR:

 

DECLARE

  my_array VARCHAR [];

  …

 

~ TIA

~ Ken

------=_NextPart_000_0052_01C60C75.E6DFEE60--