There are currently 2 ways to interface with a MySQL database, and there are most likely ways for it to interact with PSQL.
What you are trying to do with this interface, wikll depend on what the answer is.
1 of the ways to interact with MySQL (possibly PSQL, with a different package), is using a Tcl package.
This will allow you to use Tcl commands to interact, by obtaining information an manipulating the DB.
The other way for MySQL. There was a module floating about a few months back, which logged all incoming text from a IRC server. WHile this didn't allow interaction, it could be used to obtain stats, using SQL queries and a few calculations in some form of language.
There is no current way to load and save userfiles in a MySQL DB, Though it would be possible in Tcl, it would still be using eggdrops own userfile system at the same time.