pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marcelo <marcelo.nicolet@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Select into table%ROWTYPE failed
Date: Tue, 18 Sep 2018 15:38:11 -0300
Message-ID: <14186ea7-288e-c011-616c-56cd577793cd@gmail.com> (raw)
In-Reply-To: <16266.1537290626@sss.pgh.pa.us>
References: <101ff717-5edc-b671-1903-098ae1f74bd3@gmail.com>
	<16266.1537290626@sss.pgh.pa.us>

Ohh, you are right!
Thank you!

On 18/09/2018 14:10 , Tom Lane wrote:
> marcelo <marcelo.nicolet@gmail.com> writes:
>> What was wrong in the first approach?
> plpgsql's "SELECT INTO" expects a one-for-one match between the output
> columns of the SELECT and the columns of the INTO destination.  So I'd
> expect something like this to work:
>
> DECLARE
>    ranger billnumberrange%ROWTYPE;
> BEGIN
>   SELECT * FROM billnumberrange WHERE ... INTO ranger;
>
> Your example clearly wasn't selecting all the columns, and it
> wasn't clear whether you paid any attention to column ordering;
> but both of those matter.
>
> 			regards, tom lane
>


---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus





view thread (3+ messages)

Message-ID: <14186ea7-288e-c011-616c-56cd577793cd@gmail.com>
Permalink:  ../14186ea7-288e-c011-616c-56cd577793cd@gmail.com/
Also on:    postgresql.org/message-id/14186ea7-288e-c011-616c-56cd577793cd@gmail.com

 · 

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-general@postgresql.org
  Cc: marcelo.nicolet@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Select into table%ROWTYPE failed
  In-Reply-To: <14186ea7-288e-c011-616c-56cd577793cd@gmail.com>
  References: <101ff717-5edc-b671-1903-098ae1f74bd3@gmail.com> <16266.1537290626@sss.pgh.pa.us> <14186ea7-288e-c011-616c-56cd577793cd@gmail.com>

* 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