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 1lwPMc-00026f-B7 for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:25:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwPM5-0001q1-QO for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:25:17 +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 1lwPM5-0001aI-Dd for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 13:25:17 +0000 Received: from [81.169.193.36] (helo=h2931537.stratoserver.net) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwPLz-0005cD-AP for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 13:25:17 +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 23AC7D20397 for ; Thu, 24 Jun 2021 15:25:10 +0200 (CEST) Subject: Re: insert ..... returning problem To: pgsql-general@lists.postgresql.org References: <55a5f85f533342d6b4ae4f518a8a29f1f261ce45.camel@cybertec.at> From: Michael Ivanov Message-ID: <3d7fba5a-aecd-935d-c7ae-8dbfe8a253f7@isle.spb.ru> Date: Thu, 24 Jun 2021 16:25:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <55a5f85f533342d6b4ae4f518a8a29f1f261ce45.camel@cybertec.at> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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 Hallo, no. I am using postgres c library, namely I'm calling PQexec() Best regards, On 24.06.2021 16:14, Laurenz Albe wrote: > On Thu, 2021-06-24 at 12:31 +0300, Michael Ivanov wrote: >> 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? > > Are you talking about ECPG? > > Yours, > Laurenz Albe > -- \ / | | (OvO) | Михаил Иванов | (^^^) | | \^/ | E-mail: ivans@isle.spb.ru | ^ ^ | |