To see what modules your php (I assume you're using PHP. If not, please give it a try) build make a php file with phpinfo(); in it and search the output for pgsql.
If you don't have direct postgresql support, then you may be able to get by on odbc, see if that's there.
If you have one or both, then yes, you can likely get a small postgresql server up and running. Note that postgresql can use up disk space very fast especially if you update / insert and delete a lot. So you'll need to schedule a cron job to run nightly that vacuums the database and all that.
Like Chris said, if you don't have access to shared memory or you run in a strange jail setup you may not be able to do this.