You don't want to be checking for which database in tcl, because there is already a structure for that which you should always use if you're committing anything...
You should find dirs .../$service/packages/$yourpackage/sql/postgresql and .../$service/packages/$yourpackage/sql/oracle, if you would be defining pl/sql procs, they would go in the oracle dir...
Then, you can have queries in places like .../$service/packages/$yourpackage/www/somepage-oracle.xql and .../$service/packages/$yourpackage/www/somepage-postgresql.xql as well as .../$service/packages/$yourpackage/tcl/some-procs-postgresql.xql and .../$service/packages/$yourpackage/tcl/some-procs-oracle.xql and possibly other places as well; check documentation and source of openacs for details.