AWS RDS Aurora PostgreSQL Serverless: boto3: RETURNING CLAUSE

0

Hi,

This question is in reference to:

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds-data.html
<note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>

Kindly advice on how I can get the id of a newly inserted row

sql used:
INSERT INTO {0}({1})
VALUES ({2})
RETURNING id;

As mentioned in the docs, response does not contain "generatedFields".

Thank you
Derek

pkered
已提問 3 年前檢視次數 410 次
1 個回答
0

ok, I have misunderstood the docs.

the RETURNING clause will normally provide the returned data in "generatedFields". However, it does not work for Aurora PostgreSQL

  • Closed Question -

Derek

pkered
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南