Re: proposal: plpgsql pragma statement - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: plpgsql pragma statement
Date
Msg-id CAFj8pRC-H5qGjw7DqoU0shYXXJ+C+i4eN00gZ_XsjkAD9LfjuA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: plpgsql pragma statement  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Responses Re: proposal: plpgsql pragma statement  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-hackers


st 5. 12. 2018 v 15:03 odesílatel Pavel Luzanov <p.luzanov@postgrespro.ru> napsal:

But maybe your extension could read the PERFORM statement preceding it and treat it as an annotation hint for the following statement.

In this case, comment line in some format will be better than real PERFORM statement. Like this:


/*+PRAGMA cmdtype CREATE; */
EXECUTE format('CREATE TABLE xxx ...

I looked there and It is not possible to implement it - plpgsql uses SQL lexer, and the content of comments are just ignored. So I cannot to read comments. There is not any possibility to read it simply from plpgsql. Unfortunately, but it is expected, there is nothing like query string for plpgsql statement.

Regards

Pavel 
 
-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: don't mark indexes invalid unnecessarily
Next
From: "Jonah H. Harris"
Date:
Subject: Re: proposal: plpgsql pragma statement