This can cause ugly race conditions that result in incoherency issues in your data set.
Always do it with real sequences, not pseudo sequences you prorgram youself. If programmed wrong, they can corrupt your data, and at their best they do not handle race condistions gracefully, i.e. one insert fails for no real good reason.
for example, the following table:
create table yada (issues text, id serial);
with the following script:
pg_exec($conn,"begin");
$res = pg_exec($conn,"insert into yada values ('$issue'");
$oid = pg_getlastoid($res);
$res2 = pg_exec($conn,"select id from yada where oid=$oid");
$id = pg_result($res2,0,id);
$res3 = pg_exec($conn,"insert into anothertable values ('somedata',$id)");
pg_exec($conn,"end");
can be run by 100 concurrent users and they all will get their insert to run.
If you do it your way there is a real possibility of a race condition that can result in rows not being inserted properly.
pg_exec($conn,"begin");
$res = pg_exec($conn,"select max(id)+1 as id from yada");
$id = pg_result($res,0,id);
$res2 = pg_exec($conn,"insert into yada values ('$data',$id)");
$res3 = pg_exec($conn,"insert into anothertable values ('somedata',$id)");
pg_exec($conn,"end");
If you don't do it in a transaction block, then 100 concurrent users running this script will result in 99 incorrectly inserted records, whereas my example would just run slower without transactional blocking, but would still run.
The first rule of writing database apps is to always ask yourself "what would happen if two users did this at the exact same time?" and write code that can handle that situation.