Thread: Re: [partition table] python fetchall or fetchone functioncan not get the returning rows

Hi Xiaoning,

I need to say i don't have experience with RETURNING... So don't know
what could be wrong...

But the way how we usually deal with same issue is:
Serial column has sequence next value as default value... So usually we
first take next seq value and in insert we include pk column with taken
value - then the same value use later in other tables as fk...

Kind Regards,

Misa


Sent from my Windows Phone From: Xiaoning Xu
Sent: 21 December 2011 22:31
To: pgsql-general@postgresql.org
Subject: [GENERAL] [partition table] python fetchall or fetchone
function can not get the returning rows
Hello,

I have a problem concerning the partition table.
When I store a record into one of the partition and use "RETURNING
table_id" or "RETURNING *",
I expect the same result when calling fetchall or fetchone function as
not using partition.
However, it simply returns nothing.

Since  the serial primary key of my partition table is the FK of some
other tables, I need to get the
id after each insertion.
My solution now is to select the max id from the parent table.
I am wondering if there is any other alternatives to solve this problem.

Thank you in advance!
Xiaoning

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general