Re: Tempory table is not getting created inside Function in postgres.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: nikhil raj <nikhilraj474(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tempory table is not getting created inside Function in postgres.
Date: 2023-02-27 20:40:42
Message-ID: CAKFQuwabgdjHp6-NOv-mawSbshwy_5pjeFAFV5z18yjq-siAWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 27, 2023 at 1:17 PM nikhil raj <nikhilraj474(at)gmail(dot)com> wrote:

>
> The same query is executed outside the function its working properly
> means just the qurey from drop temp table to insert but when i keep the
> query inside a function its through me the error an after temp ra how
> creation only i am using the select statment still its not exectuing the
> create statment or not storing the temp table.
>
>>
>>
What Tom said is that in the following change 'sql' to plpgsql and move
on. Your function is not capable of being executed in an SQL language
function.

CREATE OR REPLACE FUNCTION api."post_publish_Roster"(
)
RETURNS void
LANGUAGE 'sql'
COST 100
VOLATILE PARALLEL UNSAFE
AS $BODY$

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kirk Wolak 2023-02-27 22:40:34 Re: pg_get_functiondef(), trailing spaces and + sign
Previous Message nikhil raj 2023-02-27 20:17:03 Re: Tempory table is not getting created inside Function in postgres.