Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwP3u-0001VF-EX for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:06:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwP3s-0002oF-RK for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:06:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwLhi-0006gU-50 for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 09:31:22 +0000 Received: from [81.169.193.36] (helo=h2931537.stratoserver.net) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwLhf-0002hL-4K for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 09:31:21 +0000 Received: from [192.168.123.201] (ip-185-108-208-37.ip.asarta.ru [185.108.208.37]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by h2931537 (Postfix) with ESMTPSA id DD56CD20397 for ; Thu, 24 Jun 2021 11:31:17 +0200 (CEST) To: pgsql-general@lists.postgresql.org From: Michael Ivanov Subject: insert ..... returning problem Message-ID: Disposition-Notification-To: Michael Ivanov Date: Thu, 24 Jun 2021 12:31:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 81.169.193.36 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greetings! I'm trying to insert a record returning column value using the following query: INSERT INTO t_load (load_id, load_type) VALUES (:id, :typ) returning load_idx INTO :idx But when I try to prepare the query I'm getting the following error: PREPARE p1515544c00000001 AS insert into t_load (load_id, load_type) values ($1, $2) returning load_idx into $3]: ERROR: syntax error at or near "into" LINE 1: ...ad_id, load_type) values ($1, $2) returning load_idx into $3 ^ Why 'into var' is not accepted here? Best regards, -- \ / | | (OvO) | Mikhail Iwanow | (^^^) | Voice: +7 (911) 223-1300 | \^/ | E-mail: ivans@logit-ag.de | ^ ^ | |