I'm surprised that this worked

Поиск
Список
Период
Сортировка
От raf
Тема I'm surprised that this worked
Дата
Msg-id 20200923013402.56zpnae4ocdu43cr@raf.org
обсуждение исходный текст
Ответы Re: I'm surprised that this worked  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
Hi,

I just wrote a query that I didn't expect to work but I
was pleasantly surprised that it did. It looked
something like this:

  select
    a.aaa,
    c.ccc,
    d.ddd1,
    d.ddd2
  from
    tbla a,
    tblb b,
    tblc c,
    funcd(c.id) d
  where
    a.something = something and
    b.something = a.something and
    c.something = b.something

How does it know which c.id to use for the function
without going all cartesian product on me? Maybe it
makes no sense for such a parameterised function to be
part of a cartesian product. Actually, that function
returns a setof record but only ever a single record.
That might be relevant.

I was sure I'd done something similar once that
(sensibly) didn't work, and I needed a loop to call the
function in, but I might be thinking of something in an
outer join's "on" clause. Does that make sense?

Even more impressed with Postgresql than usual. :-)

cheers,
raf




В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: I'm surprised that this worked