Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkD5-0005Wv-MD for pgsql-general@arkaria.postgresql.org; Fri, 14 Jun 2019 11:17:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbkD3-0008Uo-Uc for pgsql-general@arkaria.postgresql.org; Fri, 14 Jun 2019 11:17:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkD3-0008Uh-Ho for pgsql-general@lists.postgresql.org; Fri, 14 Jun 2019 11:17:29 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbkD0-0001LU-K2 for pgsql-general@postgresql.org; Fri, 14 Jun 2019 11:17:28 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id D9C0C51669; Fri, 14 Jun 2019 13:17:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id FsqkDNy1IXSu; Fri, 14 Jun 2019 13:17:08 +0200 (CEST) Message-ID: Subject: Re: How to return ARRAY from SQL function? From: Laurenz Albe To: Alexander Farber , pgsql-general Date: Fri, 14 Jun 2019 13:17:07 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Farber wrote: > But creating an SQL function fails - > > words_ru=> CREATE OR REPLACE FUNCTION words_all_letters() > words_ru-> RETURNS array AS > words_ru-> $func$ > words_ru$> SELECT ARRAY[... "array" is not an existing data type. You'll have to specify an array of which type you want, probably ... RETURNS text[] Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com