SELECT ... FOR UPDATE OF

2020-12-17 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/sql-select.html
Description:

The FOR UPDATE clause of the SELECT statement can be followed by an OF
clause, but this is never explained at all in the documentation, as far as I
can tell. What does it do? This needs to be written down.

For example, when attempting to use the OF clause in a particular query, I
get the error "FOR UPDATE must specify unqualified relation names". The
documentation doesn't provide enough information for me to understand what I
have done wrong, so I will have to use trial and error to solve my problem.


Re: The sub-categories do not have anchors on this page

2020-12-17 Thread Bruce Momjian
On Thu, Dec 10, 2020 at 05:59:15PM -0300, Álvaro Herrera wrote:
> On 2020-Dec-10, Steven Pousty wrote:
> 
> > They certainly do at the top of the page, that's why I sent the second
> > email. I was hoping to have anchors down the page where that actual topic
> > is. The rational for this is, when I write a blog post, teach a class, help
> > someone on slack... I can give them the URL right to the section I want
> > them to read. This anchor would prevent just giving the url to the whole
> > page and telling them to search for it.
> 
> Ah -- so what you want is to have something like an icon (typically a
> chain link icon) that appears next to the title, and points to itself?
> Many sites do that.  I think it's a useful idea and we should consider
> it, but it's a modification that would be done to the tooling and so
> it'd affect the whole documentation, not just this page.

I see your point --- these sub-sections are mixed with others on the
same page, so how would you know the link location?  I usually dig
through the sgml and find one, or add one if it is missing, but that is
hardly scalable.  Having a link icon makes sense --- even if they can
just click on the subsection title and the URL changes to that section
URL would be helpful.

-- 
  Bruce Momjian  https://momjian.us
  EnterpriseDB https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee





Re: SELECT ... FOR UPDATE OF

2020-12-17 Thread David G. Johnston
On Thu, Dec 17, 2020 at 5:29 AM PG Doc comments form 
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/13/sql-select.html
> Description:
>
> The FOR UPDATE clause of the SELECT statement can be followed by an OF
> clause, but this is never explained at all in the documentation, as far as
> I
> can tell. What does it do? This needs to be written down.
>

It is.  "If specific tables are named in a locking clause, then only rows
coming from those tables are locked;"


> For example, when attempting to use the OF clause in a particular query, I
> get the error "FOR UPDATE must specify unqualified relation names". The
> documentation doesn't provide enough information for me to understand what
> I
> have done wrong, so I will have to use trial and error to solve my problem.
>

A relation name is qualified if it has a schema in front of it.  I'll agree
that the docs don't indicate that "table_name" has to be unqualified.  But
mostly the OF clause points to the relations named within the query itself,
not to the original relation as recorded in the catalog.

David J.


Re: The sub-categories do not have anchors on this page

2020-12-17 Thread David G. Johnston
On Thu, Dec 17, 2020 at 8:01 AM Bruce Momjian  wrote:

> On Thu, Dec 10, 2020 at 05:59:15PM -0300, Álvaro Herrera wrote:
> > On 2020-Dec-10, Steven Pousty wrote:
> >
> > > They certainly do at the top of the page, that's why I sent the second
> > > email. I was hoping to have anchors down the page where that actual
> topic
> > > is. The rational for this is, when I write a blog post, teach a class,
> help
> > > someone on slack... I can give them the URL right to the section I want
> > > them to read. This anchor would prevent just giving the url to the
> whole
> > > page and telling them to search for it.
> >
> > Ah -- so what you want is to have something like an icon (typically a
> > chain link icon) that appears next to the title, and points to itself?
> > Many sites do that.  I think it's a useful idea and we should consider
> > it, but it's a modification that would be done to the tooling and so
> > it'd affect the whole documentation, not just this page.
>
> I see your point --- these sub-sections are mixed with others on the
> same page, so how would you know the link location?  I usually dig
> through the sgml and find one, or add one if it is missing, but that is
> hardly scalable.  Having a link icon makes sense --- even if they can
> just click on the subsection title and the URL changes to that section
> URL would be helpful.
>
>
+1

I would have used this numerous times recently when pointing people to
where to find answers to their questions.

David J.


Re: The sub-categories do not have anchors on this page

2020-12-17 Thread Jonathan S. Katz
On 12/17/20 10:11 AM, David G. Johnston wrote:
> On Thu, Dec 17, 2020 at 8:01 AM Bruce Momjian  > wrote:
> 
> On Thu, Dec 10, 2020 at 05:59:15PM -0300, Álvaro Herrera wrote:
> > On 2020-Dec-10, Steven Pousty wrote:
> >
> > > They certainly do at the top of the page, that's why I sent the
> second
> > > email. I was hoping to have anchors down the page where that
> actual topic
> > > is. The rational for this is, when I write a blog post, teach a
> class, help
> > > someone on slack... I can give them the URL right to the section
> I want
> > > them to read. This anchor would prevent just giving the url to
> the whole
> > > page and telling them to search for it.
> >
> > Ah -- so what you want is to have something like an icon (typically a
> > chain link icon) that appears next to the title, and points to itself?
> > Many sites do that.  I think it's a useful idea and we should consider
> > it, but it's a modification that would be done to the tooling and so
> > it'd affect the whole documentation, not just this page.
> 
> I see your point --- these sub-sections are mixed with others on the
> same page, so how would you know the link location?  I usually dig
> through the sgml and find one, or add one if it is missing, but that is
> hardly scalable.  Having a link icon makes sense --- even if they can
> just click on the subsection title and the URL changes to that section
> URL would be helpful.
> 
> 
> +1
> 
> I would have used this numerous times recently when pointing people to
> where to find answers to their questions.

Something to help with this has been on my backlog for a bit. We may be
able to resolve this with the pgweb CSS layer.

Jonathan



OpenPGP_signature
Description: OpenPGP digital signature


Re: where can I get the table definition and data in the documention?

2020-12-17 Thread Bruce Momjian
On Tue, Dec 15, 2020 at 06:08:55PM +0800, liming185...@126.com wrote:
> Hi,
> 
> According to the documention , I get some
>  tables  definition and data manipulation statements from the direction 
> ../src/
> tutorial(according to 2.1.introduction ),but  I can not find the table
> definition used in 3.5.window functions(the name of the table is empsalary).
> 
> So,is there another  way to get the table definition besides ../src/tutorial?
> Or should  I create these tables manually ?

I don't think we have table definitions for all our examples, sorry.

-- 
  Bruce Momjian  https://momjian.us
  EnterpriseDB https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee