Thank you! This kind of approach seems to work well:
ins = records.insert().returning(records.c.id)
result = connection.execute(ins)
row = result.fetchone()
sunnuntai 29. marraskuuta 2015 18.53.48 UTC+2 Michael Bayer kirjoitti:
>
>
>
> On 11/29/2015 10:50 AM, Sami Pietilä wrote:
> > Hi,
> >
On 11/29/2015 10:50 AM, Sami Pietilä wrote:
> Hi,
>
> I have postgresql database with "records" table. There is "id"
> (bigserial unique primary key) column. I need to insert a row in such a
> way that I get id from newly inserted row.
>
> ins = records.insert()
> results = conn.execute(ins)
>
Hi,
I have postgresql database with "records" table. There is "id" (bigserial
unique primary key) column. I need to insert a row in such a way that I get
id from newly inserted row.
ins = records.insert()
results = conn.execute(ins)
I was unable to find a code example of how to add