I have a few DB's which I can access through pgAdmin 3, I have a piece of software that can only analyze .mdb files. does anyone know how to convert/export a postgres db to a mdb? preferably through pgAdmin 3?
Thanks
You should be able to use MS Access files using ODBC (if you have a windows box available). With that you can write a small script to dump the database from one format to the other, e.g. with python using obdc, pyodbc or mxODBC packages.
a simple example can be (running on windows, not really tested, you will need to download the psycopg2 package, probably):
import odbc, psycopg2
odbc_conn = odbc.odbc("DSN=MY_ACCESS_DATABASE")
pg_conn = psycopg2.connect("host=server_name dbname=my_db user=godot password=???")
pg_curs = pg_conn.cursor()
odbc_curs = odbc_conn.cursor()
pg_curs.execute('select * from my_table')
for row in pg_curs.fetchall():
# The format depends on your table, of course
# With more work you can make it more generic, generating the
# format string from the type of the columns
odbc_curs.execute('insert into my_table values (%s,%d,%d)' % row)
.MDB is MS Access, right? I doubt pgAdmin 3 being able to do that. If Access can handle SQL then you can probably dump the Postgres databases to plain text SQL and load it into Access (with small changes, I'm guessing). If not, then you probably have to write a small program that reads from Postgres and writes to Access/MDB. Maybe there exists one already. Most converters I found using Google go in the other direction.