insert ..... returning <column> problem

From: Michael Ivanov <ivans(at)logit-ag(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: insert ..... returning <column> problem
Date: 2021-06-24 09:31:17
Message-ID: dc22ae8e-e75e-2e2a-8e93-fe9c79de0c91@logit-ag.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)logit-ag(dot)de |
^ ^ | |

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2021-06-24 11:06:46 Re: Postgres PANIC when it could not open file in pg_logical/snapshots directory
Previous Message Thorsten Schöning 2021-06-24 07:16:56 Re: [SPAM] Re: How to hash a large amount of data within Postgres?