Re: SQL-standard function body

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-03-09T12:27:48Z
Lists: pgsql-hackers

Attachments

On 05.03.21 06:58, Jaime Casanova wrote:
> I was making some tests with this patch and found this problem:
> 
> """
> CREATE OR REPLACE FUNCTION public.make_table()
>   RETURNS void
>   LANGUAGE sql
> BEGIN ATOMIC
>    CREATE TABLE created_table AS SELECT * FROM int8_tbl;
> END;
> ERROR:  unrecognized token: "?"
> CONTEXT:  SQL function "make_table"
> """

I see.  The problem is that we don't have serialization and 
deserialization support for most utility statements.  I think I'll need 
to add that eventually.  For now, I have added code to prevent utility 
statements.  I think it's still useful that way for now.

Commits

  1. Don't crash on empty statements in SQL-standard function bodies.

  2. psql: Fix line continuation prompts for unbalanced parentheses

  3. Provide query source text when parsing a SQL-standard function body.

  4. Revert "Cope with NULL query string in ExecInitParallelPlan()."

  5. Undo decision to allow pg_proc.prosrc to be NULL.

  6. SQL-standard function body

  7. Move pg_stat_statements query jumbling to core.

  8. Extend SQL function tests lightly