From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Alexander Farber <alexander.farber@gmail.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to return ARRAY from SQL function?
Date: Fri, 14 Jun 2019 13:17:07 +0200
Message-ID: <fa667d56acfa4f4bd40556ddc1ef86e63a47a9dc.camel@cybertec.at> (raw)
In-Reply-To: <CAADeyWgc-dXvuPP+Sq-xsLiauKdTZYmuco9xePa2y0a0x1PTKw@mail.gmail.com>
References: <CAADeyWgc-dXvuPP+Sq-xsLiauKdTZYmuco9xePa2y0a0x1PTKw@mail.gmail.com>
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, alexander.farber@gmail.com
Subject: Re: How to return ARRAY from SQL function?
In-Reply-To: <fa667d56acfa4f4bd40556ddc1ef86e63a47a9dc.camel@cybertec.at>
References: <CAADeyWgc-dXvuPP+Sq-xsLiauKdTZYmuco9xePa2y0a0x1PTKw@mail.gmail.com> <fa667d56acfa4f4bd40556ddc1ef86e63a47a9dc.camel@cybertec.at>
* 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