Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2KtS-0002H8-KL for pgsql-general@arkaria.postgresql.org; Tue, 18 Sep 2018 18:38:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2KtQ-0004xb-0D for pgsql-general@arkaria.postgresql.org; Tue, 18 Sep 2018 18:38:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2KtC-0003sW-Kd for pgsql-general@lists.postgresql.org; Tue, 18 Sep 2018 18:38:22 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g2Kt8-0006pF-FN for pgsql-general@postgresql.org; Tue, 18 Sep 2018 18:38:21 +0000 Received: by mail-qk1-x735.google.com with SMTP id 130-v6so1576981qkd.10 for ; Tue, 18 Sep 2018 11:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=+p4dfz2lZ/9F3N7aV60ZaG12oB6zMIo2he41/0JQDZs=; b=UXX6Inpyqey3DL8Rh4JbBXrzom27D6YCFQTrzXSxvL/JwjfnlHHeGyx3VwSSJE4FLi xAJhBx4F4KxZUA6u567VmDYh5LGsRntEg2Gs0Nnw57LyQ2ohReYK9PYiwjUFXZKfw3lO NpO9AlEjclYevZD6JjgsMsdiUBGU00+piY6ad4DwbVyBM7XwUOtfeeeNlRlGvije2iVp v0xt8Yi66reBPSi506apj54AQsZDOSJsk6GiwMlldqdqVWBZyhw8MSO4rT4du1j/VSz/ y6zK8XHxQeipIXd77Le7X9jJ3RV7gdXizlkr/+mJFT5JyogX3TclY+bEQoiBlgOMLem7 lPUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=+p4dfz2lZ/9F3N7aV60ZaG12oB6zMIo2he41/0JQDZs=; b=FZP+sC2NNxjmszbsyVZqiTP8qjy94i4An35Ljf/w2H6c0xzvdwCiFuUP2/WInTFGXv 7mi6GYAIUiD3aIjaFqt06qoeUTNij9NV9Qm0dDJMY0Qmf5VVMDyBW6IVXdBS63SLOkEy /IVMGv8wiUvtnsfF2KGagL+tP8LLbD6gQ/yjAPchwaBAOQ6h2iq+CNt3T9BNhcFiye+I Z9OVEVn2TU6nCMjr/UBorRJUK7SjgO+l4IIxcqS6RalYUXOfRQpI9KjuEXJTRroc1OHq Kl05VShhfFBQYU4CyS1kJxP4bQsKySB5M07gMqPGH5O1FPb+G4OIEYHkDWxXLGqzOOct SBfA== X-Gm-Message-State: APzg51CGbgcMUyK/buqiP249KorFwDz+JRx18oPS1fEntzXpHIEIhh1u SPGPTqf8Xo0VoLyX4Xtef8Ez0pV9 X-Google-Smtp-Source: ANB0VdZfJ/oZzi+QonUeo5GixgbJdtex68jqJT/MrrmwVpLGJAmFAXkaVTKlT89YzgQNYsv03ERHNA== X-Received: by 2002:a37:4ecb:: with SMTP id c194-v6mr21188576qkb.345.1537295896539; Tue, 18 Sep 2018 11:38:16 -0700 (PDT) Received: from [192.168.1.250] (host130.190-229-77.telecom.net.ar. [190.229.77.130]) by smtp.gmail.com with ESMTPSA id 56-v6sm14813042qtw.31.2018.09.18.11.38.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 11:38:16 -0700 (PDT) Subject: Re: Select into table%ROWTYPE failed To: Tom Lane Cc: "pgsql-general@postgresql.org" References: <101ff717-5edc-b671-1903-098ae1f74bd3@gmail.com> <16266.1537290626@sss.pgh.pa.us> From: marcelo Message-ID: <14186ea7-288e-c011-616c-56cd577793cd@gmail.com> Date: Tue, 18 Sep 2018 15:38:11 -0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <16266.1537290626@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Antivirus: Avast (VPS 180918-0, 18/09/2018), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ohh, you are right! Thank you! On 18/09/2018 14:10 , Tom Lane wrote: > marcelo 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=C3=B3nico en= busca de virus. https://www.avast.com/antivirus