Just one quick question again about my first problem, is that a limitation that code between begin and commit can't send back the id, or was it just a problem about my code ?
I think there is a bug in Your code:
BEGIN;
INSERT INTO table1 (id, name) VALUES (DEFAULT, 'name_of_the_entry');
UPDATE table2 SET table1_id = CURRVAL('table1_id_seq') WHERE id = 'some_row_id';
SELECT CURRVAL('parts_id_seq') AS table1_id;
COMMIT;
I looks like You are trying to select current value of other sequence. You are trying to use table1_id_seq for update and parts_id_seq for select.
I tried similar code:
BEGIN;
INSERT INTO "tblParent" ("RowValue") VALUES ('2012-01-02'::date);
UPDATE "tblChild"
SET "ParentRowId" = currval('"tblParent_RowId_seq"'::regclass)