public inbox for [email protected]  
help / color / mirror / Atom feed
Global dict name is listed inconsistently
4+ messages / 3 participants
[nested] [flat]

* Global dict name is listed inconsistently
@ 2018-08-21 09:17  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Doc comments form @ 2018-08-21 09:17 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/plpython-sharing.html
Description:

Page https://www.postgresql.org/docs/10/static/plpython-sharing.html  says:
"The global dictionary SD is available to store data between function
calls." few lines lower it says: "global data and function arguments from
myfunc are not available to myfunc2. The exception is the data in the GD
dictionary, as mentioned above." Note that the global dictionary is named
"SD" in the first quote and "GD" in the second one.

Please correct either first or second sentence.

Kind regards,

Adam Bielański
Happy PostgreSQL user :)


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Global dict name is listed inconsistently
@ 2018-08-24 18:05  Bruce Momjian <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Bruce Momjian @ 2018-08-24 18:05 UTC (permalink / raw)
  To: [email protected]; [email protected]

On Tue, Aug 21, 2018 at 09:17:35AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/10/static/plpython-sharing.html
> Description:
> 
> Page https://www.postgresql.org/docs/10/static/plpython-sharing.html  says:
> "The global dictionary SD is available to store data between function
> calls." few lines lower it says: "global data and function arguments from
> myfunc are not available to myfunc2. The exception is the data in the GD
> dictionary, as mentioned above." Note that the global dictionary is named
> "SD" in the first quote and "GD" in the second one.
> 
> Please correct either first or second sentence.

Well, the documentation is correct, but obviously not clear.  I have the
attached patch which modifies the documentation and clarifies this
issue.  Does it help you?

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


Attachments:

  [text/x-diff] plpython.diff (1.1K, 2-plpython.diff)
  download | inline diff:
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
new file mode 100644
index d086ddf..60a5907
*** a/doc/src/sgml/plpython.sgml
--- b/doc/src/sgml/plpython.sgml
*************** SELECT * FROM multiout_simple_setof(3);
*** 768,776 ****
    <title>Sharing Data</title>
    <para>
     The global dictionary <varname>SD</varname> is available to store
!    data between function calls.  This variable is private static data.
     The global dictionary <varname>GD</varname> is public data,
!    available to all Python functions within a session.  Use with
     care.<indexterm><primary>global data</primary>
     <secondary>in PL/Python</secondary></indexterm>
    </para>
--- 768,776 ----
    <title>Sharing Data</title>
    <para>
     The global dictionary <varname>SD</varname> is available to store
!    private data between repeated calls to the same function.
     The global dictionary <varname>GD</varname> is public data,
!    that is available to all Python functions within a session;  use with
     care.<indexterm><primary>global data</primary>
     <secondary>in PL/Python</secondary></indexterm>
    </para>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Global dict name is listed inconsistently
@ 2018-08-24 18:43  Adam <[email protected]>
  parent: Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Adam @ 2018-08-24 18:43 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: [email protected]; [email protected]

Yes, it does, thank you.

Now it's clear why there are two different names.

Best regards,

Adam Bielański

pt., 24 sie 2018, 20:05 użytkownik Bruce Momjian <[email protected]> napisał:

> On Tue, Aug 21, 2018 at 09:17:35AM +0000, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/10/static/plpython-sharing.html
> > Description:
> >
> > Page https://www.postgresql.org/docs/10/static/plpython-sharing.html
> says:
> > "The global dictionary SD is available to store data between function
> > calls." few lines lower it says: "global data and function arguments from
> > myfunc are not available to myfunc2. The exception is the data in the GD
> > dictionary, as mentioned above." Note that the global dictionary is named
> > "SD" in the first quote and "GD" in the second one.
> >
> > Please correct either first or second sentence.
>
> Well, the documentation is correct, but obviously not clear.  I have the
> attached patch which modifies the documentation and clarifies this
> issue.  Does it help you?
>
> --
>   Bruce Momjian  <[email protected]>        http://momjian.us
>   EnterpriseDB                             http://enterprisedb.com
>
> + As you are, so once was I.  As I am, so you will be. +
> +                      Ancient Roman grave inscription +
>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Global dict name is listed inconsistently
@ 2018-08-25 15:52  Bruce Momjian <[email protected]>
  parent: Adam <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Bruce Momjian @ 2018-08-25 15:52 UTC (permalink / raw)
  To: Adam <[email protected]>; +Cc: [email protected]; [email protected]

On Fri, Aug 24, 2018 at 08:43:21PM +0200, Adam wrote:
> Yes, it does, thank you.
> 
> Now it's clear why there are two different names. 

Patch backpatched through 9.3.  Thanks for the report.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-08-25 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-21 09:17 Global dict name is listed inconsistently PG Doc comments form <[email protected]>
2018-08-24 18:05 ` Bruce Momjian <[email protected]>
2018-08-24 18:43   ` Adam <[email protected]>
2018-08-25 15:52     ` Bruce Momjian <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox