![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Using libpq, is there any way following an 'insert into partitioned_table' to determine whether any rows were inserted? |
#3
| |||
| |||
|
|
When using the partitioning scheme using triggers as suggested in the postgresql 8.4 documentation section 5.9.2, after inserting a record into the 'parent' table PQcmdTuples() returns 0 rows inserted. Presumably this is because the trigger function redirects the insert to the appropriate child table. I see this with both 8.4.4 and 9.0beta3. Using libpq, is there any way following an 'insert into partitioned_table' to determine whether any rows were inserted? |
#4
| |||
| |||
|
|
On Wed, 04 Aug 2010 08:51:30 +0100, Graham Murray wrote: Using libpq, is there any way following an 'insert into partitioned_table' to determine whether any rows were inserted? It is a relational database, if there is no error, you have to assume that rows were inserted .... somewhere? |
#5
| |||
| |||
|
|
That's true, but the OP might be interested in the number of rows inserted (e.g. in case of an INSERT combined with SELECT). Executing the SELECT twice has a performance penalty and might lead incorrect results (if other INSERTS occur between the SELECT and INSERT). Kind regards |
![]() |
| Thread Tools | |
| Display Modes | |
| |