Re: How to return ARRAY from SQL function?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to return ARRAY from SQL function?
Date: 2019-06-14 11:17:07
Message-ID: fa667d56acfa4f4bd40556ddc1ef86e63a47a9dc.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-06-14 13:25:32 Re: How to return ARRAY from SQL function?
Previous Message Alexander Farber 2019-06-14 11:09:58 How to return ARRAY from SQL function?