David,
> Does fetching that OID inside a transaction automatically guarantee
> that the right thing happens?
Maybe, maybe not. Regardless, you're making an easy task hard. You'd be
better off staying away from OIDs entirely:
> INSERT INTO foo (foo_desc)
> VALUES ('too much unix!')
> -- Fetch the $foo_id, or roll back if unable.
$new_foo = currval('foo_foo_id_seq')
> INSERT INTO bar (bar_desc, foo_id)
> VALUES ('never too much unix!', $new_foo)
I'd suggest reading the docs on sequences. There is no reason for you ever to
use OIDs at all.
--
Josh Berkus
Aglio Database Solutions
San Francisco