Search Postgresql Archives

Re: [partition table] python fetchall or fetchone function can not get the returning rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
Subject:  [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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux