Re: Inserting a constant along with field values.

From: Pól Ua Laoínecháin <linehanp(at)tcd(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Inserting a constant along with field values.
Date: 2020-04-12 20:25:00
Message-ID: CAF4RT5QK-qZ=JTKHfEcZHDcc1vrNpPjfrp6m2KHAeEa5-fPvFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> If you're trying to figure out what the join condition should be:
> you don't need one, because the single row from "cte c" is supposed
> to join to every row of the x/y join result. So you could just
> write "ON true". Or leave it off altogether by writing CROSS JOIN,
> or by using comma syntax, like

> ... FROM xtab x JOIN ytab y ON x.x_key = y.y_key, cte c

That worked a treat, thanks Tom! I was wandering (lonely as a cloud
perhaps?) along that route, but I just couldn't get it to work. Maybe
I just needed the input of someone like yourself to convince me that I
was, in fact, on the right track.

Thanks again and rgs,

Pól...

> regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Bannister 2020-04-16 22:40:09 PL/pgsql insert into failing even with returning into clause
Previous Message Tom Lane 2020-04-12 17:21:54 Re: Inserting a constant along with field values.