Re: proposal: plpgsql pragma statement

2019-04-09 Thread Pavel Stehule
Hi út 9. 4. 2019 v 15:03 odesílatel David Steele napsal: > Hi Pavel, > > On 3/25/19 3:50 AM, Pavel Stehule wrote: > > po 25. 3. 2019 v 8:38 odesílatel David Steele > > napsal: > > > > On 3/10/19 8:39 PM, Pavel Stehule wrote: > > > Here is pragma patch

Re: proposal: plpgsql pragma statement

2019-04-09 Thread David Steele
Hi Pavel, On 3/25/19 3:50 AM, Pavel Stehule wrote: > po 25. 3. 2019 v 8:38 odesílatel David Steele > napsal: > > On 3/10/19 8:39 PM, Pavel Stehule wrote: > >     Here is pragma patch with demo > We're still not getting real review for this patch and

Re: Re: proposal: plpgsql pragma statement

2019-03-25 Thread Pavel Stehule
po 25. 3. 2019 v 8:38 odesílatel David Steele napsal: > Hi Pavel, > > On 3/10/19 8:39 PM, Pavel Stehule wrote: > > Here is pragma patch with demo > We're still not getting real review for this patch and Andrew seems as > skeptical as anyone that this is the right way to go. > > I'm planning

Re: Re: proposal: plpgsql pragma statement

2019-03-25 Thread David Steele
Hi Pavel, On 3/10/19 8:39 PM, Pavel Stehule wrote: Here is pragma patch with demo We're still not getting real review for this patch and Andrew seems as skeptical as anyone that this is the right way to go. I'm planning to mark it as rejected at the end of this CF. Regards, -- -David

Re: proposal: plpgsql pragma statement

2019-03-10 Thread Pavel Stehule
so 9. 3. 2019 v 22:17 odesílatel Pavel Stehule napsal: > > > čt 7. 3. 2019 v 18:45 odesílatel Andrew Dunstan < > andrew.duns...@2ndquadrant.com> napsal: > >> >> On 3/7/19 12:41 PM, Pavel Stehule wrote: >> > >> > >> > čt 7. 3. 2019 v 18:35 odesílatel Andrew Dunstan >> > > >

Re: proposal: plpgsql pragma statement

2019-03-09 Thread Pavel Stehule
čt 7. 3. 2019 v 18:45 odesílatel Andrew Dunstan < andrew.duns...@2ndquadrant.com> napsal: > > On 3/7/19 12:41 PM, Pavel Stehule wrote: > > > > > > čt 7. 3. 2019 v 18:35 odesílatel Andrew Dunstan > > > > napsal: > > > > > > > > > > The other thing that

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Pavel Stehule
čt 7. 3. 2019 v 18:45 odesílatel Andrew Dunstan < andrew.duns...@2ndquadrant.com> napsal: > > On 3/7/19 12:41 PM, Pavel Stehule wrote: > > > > > > čt 7. 3. 2019 v 18:35 odesílatel Andrew Dunstan > > > > napsal: > > > > > > > > > > The other thing that

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Andrew Dunstan
On 3/7/19 12:41 PM, Pavel Stehule wrote: > > > čt 7. 3. 2019 v 18:35 odesílatel Andrew Dunstan > > napsal: > > > > > The other thing that bugs me a bit about the patch is that the only > testing it does it to make sure that pragmas are ignored by

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Pavel Stehule
čt 7. 3. 2019 v 18:35 odesílatel Andrew Dunstan < andrew.duns...@2ndquadrant.com> napsal: > > On 3/7/19 11:45 AM, Pavel Stehule wrote: > > > > > > > > > > I have looked at the latest patch, but it seems inadequate unless I'm > > misreading it. I think a general pragma mechanism should

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Andrew Dunstan
On 3/7/19 11:45 AM, Pavel Stehule wrote: > > > > > I have looked at the latest patch, but it seems inadequate unless I'm > misreading it. I think a general pragma mechanism should allow a > pragma > just about anywhere. If the processor doesn't recognize the pragma it >

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Pavel Stehule
čt 7. 3. 2019 v 14:40 odesílatel Andrew Dunstan < andrew.duns...@2ndquadrant.com> napsal: > > On 3/7/19 3:19 AM, Pavel Stehule wrote: > > Hi > > > > čt 7. 3. 2019 v 8:03 odesílatel David Steele > > napsal: > > > > On 2/4/19 8:12 PM, Pavel Stehule wrote: > > >

Re: proposal: plpgsql pragma statement

2019-03-07 Thread Andrew Dunstan
On 3/7/19 3:19 AM, Pavel Stehule wrote: > Hi > > čt 7. 3. 2019 v 8:03 odesílatel David Steele > napsal: > > On 2/4/19 8:12 PM, Pavel Stehule wrote: > > > >   attached rebased patch > > This patch has gone through a few iterations but I don't think >

Re: Re: proposal: plpgsql pragma statement

2019-03-07 Thread Pavel Stehule
Hi čt 7. 3. 2019 v 8:03 odesílatel David Steele napsal: > On 2/4/19 8:12 PM, Pavel Stehule wrote: > > > > attached rebased patch > > This patch has gone through a few iterations but I don't think there's > any agreement on what it should look like. There's been no code review > that I can

Re: Re: proposal: plpgsql pragma statement

2019-03-06 Thread David Steele
On 2/4/19 8:12 PM, Pavel Stehule wrote:  attached rebased patch This patch has gone through a few iterations but I don't think there's any agreement on what it should look like. There's been no code review that I can see. I think this should be pushed to PG13 at the least, perhaps

Re: proposal: plpgsql pragma statement

2019-02-04 Thread Pavel Stehule
Hi, po 4. 2. 2019 v 6:10 odesílatel Michael Paquier napsal: > On Fri, Jan 04, 2019 at 02:17:49PM +0100, Pavel Stehule wrote: > > It means to write own lexer and preparse source code before I start > > checking. > > > > I think so block level PRAGMA is significantly better solution > > Please

Re: proposal: plpgsql pragma statement

2019-02-03 Thread Michael Paquier
On Fri, Jan 04, 2019 at 02:17:49PM +0100, Pavel Stehule wrote: > It means to write own lexer and preparse source code before I start > checking. > > I think so block level PRAGMA is significantly better solution Please note that the latest patch is failing to apply, so I have moved the patch to

Re: proposal: plpgsql pragma statement

2019-01-04 Thread Pavel Stehule
pá 4. 1. 2019 v 14:07 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > On 06/12/2018 18:27, Pavel Stehule wrote: > > For my purpose I can imagine PRAGMA on function level with same syntax > > like PL/SQL - I need to push somewhere some information that I can use > > for

Re: proposal: plpgsql pragma statement

2019-01-04 Thread Peter Eisentraut
On 06/12/2018 18:27, Pavel Stehule wrote: > For my purpose I can imagine PRAGMA on function level with same syntax > like PL/SQL - I need to push somewhere some information that I can use > for plpgsql_check to protect users against false alarms. The locality in > this moment is not too important

Re: proposal: plpgsql pragma statement

2018-12-16 Thread Pavel Stehule
Hi st 12. 12. 2018 v 9:03 odesílatel Pavel Stehule napsal: > > > čt 6. 12. 2018 v 18:27 odesílatel Pavel Stehule > napsal: > >> >> >> čt 6. 12. 2018 v 18:17 odesílatel Robert Haas >> napsal: >> >>> On Thu, Dec 6, 2018 at 12:13 PM Pavel Stehule >>> wrote: >>> > My idea about plpgsql PRAGMA is

Re: proposal: plpgsql pragma statement

2018-12-12 Thread Pavel Stehule
čt 6. 12. 2018 v 18:27 odesílatel Pavel Stehule napsal: > > > čt 6. 12. 2018 v 18:17 odesílatel Robert Haas > napsal: > >> On Thu, Dec 6, 2018 at 12:13 PM Pavel Stehule >> wrote: >> > My idea about plpgsql PRAGMA is very close to PL/SQL or Ada PRAGMA. >> This is not runtime statement - the

Re: proposal: plpgsql pragma statement

2018-12-07 Thread Pavel Stehule
pá 7. 12. 2018 v 21:28 odesílatel Robert Haas napsal: > On Thu, Dec 6, 2018 at 12:28 PM Pavel Stehule > wrote: > > please, can you propose, some what you like? > > > > For my purpose I can imagine PRAGMA on function level with same syntax > like PL/SQL - I need to push somewhere some

Re: proposal: plpgsql pragma statement

2018-12-07 Thread Robert Haas
On Thu, Dec 6, 2018 at 12:28 PM Pavel Stehule wrote: > please, can you propose, some what you like? > > For my purpose I can imagine PRAGMA on function level with same syntax like > PL/SQL - I need to push somewhere some information that I can use for > plpgsql_check to protect users against

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Pavel Stehule
čt 6. 12. 2018 v 18:17 odesílatel Robert Haas napsal: > On Thu, Dec 6, 2018 at 12:13 PM Pavel Stehule > wrote: > > My idea about plpgsql PRAGMA is very close to PL/SQL or Ada PRAGMA. This > is not runtime statement - the information from this command will be > assigned to related object -

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Robert Haas
On Thu, Dec 6, 2018 at 12:13 PM Pavel Stehule wrote: > My idea about plpgsql PRAGMA is very close to PL/SQL or Ada PRAGMA. This is > not runtime statement - the information from this command will be assigned to > related object - function, block, command at parser time. That's sensible, but

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Pavel Stehule
čt 6. 12. 2018 v 18:05 odesílatel Pavel Stehule napsal: > > > čt 6. 12. 2018 v 17:57 odesílatel Robert Haas > napsal: > >> On Thu, Dec 6, 2018 at 11:39 AM Jonah H. Harris >> wrote: >> > IIRC, PRAGMA in Ada was compile-time only. How would you foresee it >> affecting runtime? >> >> Well, I

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Pavel Stehule
čt 6. 12. 2018 v 17:57 odesílatel Robert Haas napsal: > On Thu, Dec 6, 2018 at 11:39 AM Jonah H. Harris > wrote: > > IIRC, PRAGMA in Ada was compile-time only. How would you foresee it > affecting runtime? > > Well, I don't know what Ada does with PRAGMA exactly, but look at > these examples

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Jonah H. Harris
Ahh. Gotcha. Makes sense. On Thu, Dec 6, 2018 at 11:57 AM Robert Haas wrote: > On Thu, Dec 6, 2018 at 11:39 AM Jonah H. Harris > wrote: > > IIRC, PRAGMA in Ada was compile-time only. How would you foresee it > affecting runtime? > > Well, I don't know what Ada does with PRAGMA exactly, but

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Robert Haas
On Thu, Dec 6, 2018 at 11:39 AM Jonah H. Harris wrote: > IIRC, PRAGMA in Ada was compile-time only. How would you foresee it affecting > runtime? Well, I don't know what Ada does with PRAGMA exactly, but look at these examples from Oracle: http://psoug.org/definition/pragma.htm You wouldn't

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Pavel Stehule
čt 6. 12. 2018 v 17:27 odesílatel Robert Haas napsal: > On Tue, Dec 4, 2018 at 12:13 PM Pavel Stehule > wrote: > > I wrote plpgsql_check https://github.com/okbob/plpgsql_check. > > > > It is working well, but because it does static analyse only, sometimes > it can produces false alarms or it

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Jonah H. Harris
IIRC, PRAGMA in Ada was compile-time only. How would you foresee it affecting runtime? On Thu, Dec 6, 2018 at 11:27 AM Robert Haas wrote: > On Tue, Dec 4, 2018 at 12:13 PM Pavel Stehule > wrote: > > I wrote plpgsql_check https://github.com/okbob/plpgsql_check. > > > > It is working well, but

Re: proposal: plpgsql pragma statement

2018-12-06 Thread Robert Haas
On Tue, Dec 4, 2018 at 12:13 PM Pavel Stehule wrote: > I wrote plpgsql_check https://github.com/okbob/plpgsql_check. > > It is working well, but because it does static analyse only, sometimes it can > produces false alarms or it should to stop a analyse, because there are not > necessary data.

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
st 5. 12. 2018 v 19:12 odesílatel Dmitry Igrishin napsal: > вт, 4 дек. 2018 г. в 20:13, Pavel Stehule : > > > > Hi > > > > I wrote plpgsql_check https://github.com/okbob/plpgsql_check. > > > > It is working well, but because it does static analyse only, sometimes > it can produces false alarms

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Dmitry Igrishin
вт, 4 дек. 2018 г. в 20:13, Pavel Stehule : > > Hi > > I wrote plpgsql_check https://github.com/okbob/plpgsql_check. > > It is working well, but because it does static analyse only, sometimes it can > produces false alarms or it should to stop a analyse, because there are not > necessary data. >

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
Hi st 5. 12. 2018 v 18:28 odesílatel Jonah H. Harris napsal: > You can alter the lexer and create a comment node, right? That’s how we > did hints in EnterpriseDB. > I don't think so it is adequate solution - sure, it is, if I would to implement Oracle's hints. But it is not my target. I

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Jonah H. Harris
You can alter the lexer and create a comment node, right? That’s how we did hints in EnterpriseDB. On Wed, Dec 5, 2018 at 11:41 AM Pavel Stehule wrote: > > > st 5. 12. 2018 v 15:03 odesílatel Pavel Luzanov > napsal: > >> >> But maybe your extension could read the PERFORM statement preceding it

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
st 5. 12. 2018 v 15:03 odesílatel Pavel Luzanov 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

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
st 5. 12. 2018 v 15:03 odesílatel Pavel Luzanov 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

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
st 5. 12. 2018 v 14:42 odesílatel Alexey Bashtanov napsal: > > >> You can use PERFORM as a workaround: >> >> PERFORM 'PRAGMA', 'cmdtype', 'CREATE'; >> >> There's some overhead when executing, but probably not too much. >> > > Thank you for tip, but I have not any idea, how it can work? > > >

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Luzanov
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

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Alexey Bashtanov
You can use PERFORM as a workaround: PERFORM 'PRAGMA', 'cmdtype', 'CREATE'; There's some overhead when executing, but probably not too much. Thank you for tip, but I have not any idea, how it can work? Well, I thought you were for a comment-like thing that remains there

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Pavel Stehule
Hi st 5. 12. 2018 v 12:42 odesílatel Alexey Bashtanov napsal: > Hello Pavel, > > > > > The PRAGMA statement does nothing in runtime. It works only in compile > > time, and add a pair of key, value to next non pragma statement. This > > information can be used by some plpgsql extensions. > > > >

Re: proposal: plpgsql pragma statement

2018-12-05 Thread Alexey Bashtanov
Hello Pavel, The PRAGMA statement does nothing in runtime. It works only in compile time, and add a pair of key, value to next non pragma statement. This information can be used by some plpgsql extensions. What do you think about this proposal? You can use PERFORM as a workaround: