Re: Execute command in PL/pgSQL function not executing - Mailing list pgsql-general

From Marc Millas
Subject Re: Execute command in PL/pgSQL function not executing
Date
Msg-id CADX_1abjxaUmfPpq_M9eKU31TBLx_UBDcF+Lp5z9G5K2vzp8gA@mail.gmail.com
Whole thread Raw
In response to Re: Execute command in PL/pgSQL function not executing  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Execute command in PL/pgSQL function not executing  (Michael Lewis <mlewis@entrata.com>)
List pgsql-general
Hi, 
Just one question
Isn't it possible to write a function that return an oid?
So.. One can write a function which create a temp table, feed it according to parameters and then return the oid of the created temp table.

No?? 

Le ven. 19 nov. 2021 à 23:48, David G. Johnston <david.g.johnston@gmail.com> a écrit :
On Fri, Nov 19, 2021 at 3:37 PM Abdul Mohammed <imonikemohammed@gmail.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.

pgsql-general by date:

Previous
From: "Huang Wang"
Date:
Subject: Error when rewriting a query into multiple queries
Next
From: Michael Lewis
Date:
Subject: Re: Execute command in PL/pgSQL function not executing