best way for programing db apps in pgsql is to use stored procedures. They runs faster than
sending multiple queries to db, you can easily handle cases like this in stored procedures.
CREATE OR REPLACE FUNCTION bb_login(user_id text, ident text, logged timestamp) returns void as '
That one is way over my head. :D Where/how would that code be placed to utilise it?
place definitions of stored procedures into SQL statements used during install for creating tables, indexes, etc.
They can be called like other functions from SQL statements. Instead of coding INSERT into ... call procedure
using SELECT bb_login(arg1,arg2,arg3) MySQL5 supports stored procedure too, but syntax is bit different.