pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Pantelis Theodosiou <ypercube@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: dv <udv.mail@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: ORDER BY TABLENAME, possible bug
Date: Fri, 18 Nov 2016 18:33:30 -0500
Message-ID: <9267.1479512010@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYxpywGJgdvtsVrRXTgCDd5xNYe9abCyfv3EFJNuKXOjg@mail.gmail.com>
References: <CAGwx4BnDQZyJJpzom-UU15wh7s3DQE=ChEdEDQ2+rd5S7S2UNA@mail.gmail.com>
	<CAFj8pRCkPrb=OfOa6A63WpLJExXkKDg1GKfJ4bPs8088bcBAFA@mail.gmail.com>
	<CAE3TBxwNsfrHJc=XaTpZ3aq6=Z4PevcqQgQOi3wAh7mNB8pioA@mail.gmail.com>
	<CAKFQuwYxpywGJgdvtsVrRXTgCDd5xNYe9abCyfv3EFJNuKXOjg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Fri, Nov 18, 2016 at 3:35 PM, Pantelis Theodosiou <ypercube@gmail.com>
> wrote:
>> Is this somewhere in the documentation?

> ​https://www.postgresql.org/docs/9.6/static/rowtypes.html
> ​"Whenever you create a table, a composite type is also automatically
> created, with the same name as the table, to represent the table's row
> type."

> So, its documented and in technically correct location.  I'm not sure if
> introducing this material in a "tutorial" would be a gain or just confuse
> the student.  It seems to be something one picks up somehow (trial and
> error, mailing list, stumbling upon it in the docs or elsewhere on the
> Internet) as one increases their knowledge of SQL to an intermediate level.

There's a whole bunch of behaviors around composite values that are
documented in scattered places, some of which are completely not where
you'd expect to look.  In this example, the fact that you can use a table
name/alias to represent the composite value of the current row is
something that isn't exactly obvious, much less how that relates to other
possible spellings such as "TABLENAME.*".  We had a related question just
a couple weeks ago, which caused me to wonder (not for the first time)
whether we could pull together some sort of unified presentation.
I haven't done anything about it though.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <9267.1479512010@sss.pgh.pa.us>
Permalink:  ../9267.1479512010@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9267.1479512010@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, ypercube@gmail.com, pavel.stehule@gmail.com, udv.mail@gmail.com
  Subject: Re: ORDER BY TABLENAME, possible bug
  In-Reply-To: <9267.1479512010@sss.pgh.pa.us>
  References: <CAGwx4BnDQZyJJpzom-UU15wh7s3DQE=ChEdEDQ2+rd5S7S2UNA@mail.gmail.com> <CAFj8pRCkPrb=OfOa6A63WpLJExXkKDg1GKfJ4bPs8088bcBAFA@mail.gmail.com> <CAE3TBxwNsfrHJc=XaTpZ3aq6=Z4PevcqQgQOi3wAh7mNB8pioA@mail.gmail.com> <CAKFQuwYxpywGJgdvtsVrRXTgCDd5xNYe9abCyfv3EFJNuKXOjg@mail.gmail.com> <9267.1479512010@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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