Re: Execute command in PL/pgSQL function not executing

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Abdul Mohammed <imonikemohammed(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Execute command in PL/pgSQL function not executing
Date: 2021-11-19 22:48:02
Message-ID: CAKFQuwYHpg5u5XwH4SNqG0HOq2LrgtRMxxtx=f0n5kmcY0EjwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 19, 2021 at 3:37 PM Abdul Mohammed <imonikemohammed(at)gmail(dot)com>
wrote:

> I read somewhere that you could have a table as a return type. I,
> therefore tried using the pivot table alias as the return type but got an
> error along lines of the alias not being recognized.
>

A table in that context is something you create using the "Create table"
command. And, per my other comments, you have to have done this before
even creating the function in question since the function has to point to
the table during the "create function" command's execution.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Huang Wang 2021-11-19 23:04:15 Error when rewriting a query into multiple queries
Previous Message Abdul Mohammed 2021-11-19 22:43:03 Re: Execute command in PL/pgSQL function not executing