Re: Documentation does not cover multiple WITH in one query

2018-08-26 Thread Bruce Momjian
On Sun, Aug 26, 2018 at 12:08:15PM +0300, KES wrote:
> 
> Thank you. That is I am looking for.
> Never thought that 'WITH' syntax is described at 'SELECT'. 
> 
> Will be very helpful if this will be mentioned on this page: 
> https://www.postgresql.org/docs/10/static/queries-with.html
> For an example:
> 
>[ WITH [ RECURSIVE ] with_query [, ...] ]
> 
> and with_query is shown as:
> 
>with_query_name [ ( column_name [, ...] ) ] AS ( select | values | 
> insert | update | delete )
> 
> For full syntax of `WITH` see 
> https://www.postgresql.org/docs/10/static/sql-select.html

There is are no syntax layouts on this page or in similar sections in
the docs --- they are reserved for the reference pages.  I don't think
it makes sense to add it here.  One odd thing is that WITH can be used
with non-SELECT statements, but we only document it in SELECT, which is
odd.  I think that is because the SQL standard only uses WITH with
SELECT.

-- 
  Bruce Momjian  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 +



Re: Global dict name is listed inconsistently

2018-08-26 Thread Adam
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  napisał:

> On Tue, Aug 21, 2018 at 09:17:35AM +, 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  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 +
>


Re: 25.3. Continuous Archiving : Unix examples with Windows-style variables %-$

2018-08-26 Thread Milivoj Ivkovic




These are special variables that PostgreSQL replaces regardless of
operating system. Per the paragraph above the examples:


Oops! Sorry. Should read more thoroughly before sending stupid comments 
on this excellent documentation!


Thank you for taking the time to clarify.

Mi




Re: Documentation does not cover multiple WITH in one query

2018-08-26 Thread KES


Thank you. That is I am looking for.
Never thought that 'WITH' syntax is described at 'SELECT'. 

Will be very helpful if this will be mentioned on this page: 
https://www.postgresql.org/docs/10/static/queries-with.html
For an example:

   [ WITH [ RECURSIVE ] with_query [, ...] ]

and with_query is shown as:

   with_query_name [ ( column_name [, ...] ) ] AS ( select | values | 
insert | update | delete )

For full syntax of `WITH` see 
https://www.postgresql.org/docs/10/static/sql-select.html


Thanks.

24.08.2018, 23:30, "Bruce Momjian" :
> On Wed, Aug 22, 2018 at 09:24:52AM +, PG Doc comments form wrote:
>>  The following documentation comment has been logged on the website:
>>
>>  Page: https://www.postgresql.org/docs/10/static/queries-with.html
>>  Description:
>>
>>  Hi. I have found
>>  [DOC](https://www.postgresql.org/docs/10/static/queries-with.html)
>>
>>  it is fine, but did not cover multiple WITH in one query.
>>
>>  I found answer only [here](https://stackoverflow.com/a/38137037/4632019)
>>
>>  May you please add the example:
>>
>>  WITH table1 AS (...), table2 AS (...) SELECT * FROM table1, table2
>
> Well, the SELECT manual has:
>
>    [ WITH [ RECURSIVE ] with_query [, ...] ]
>
> and with_query is shown as:
>
>    with_query_name [ ( column_name [, ...] ) ] AS ( select | values | 
> insert | update | delete )
>
> This is standard SQL. I don't think we are going to be able to show
> every possible syntax.
>
> --
>   Bruce Momjian  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 +