You read blenders data and create insert statements for postgresql. As blender contains a python interpreter, you can run a python script in blender that sends the data to postgresql.
The first step is installing a python postgresql module, such as psycopg that can be used within blender. There are several options for this, including adding a path to sys.path
.
Once you can run a python script in blender that can talk to a postgresql server, read blenders mesh data to generate the insert statements.
pg_insert = 'INSERT INTO mytable (v_loc) VALUES ('
for v in obj.data.vertices:
pg_insert += 'POINT({} {} {}),'.format(v.co.x, v.co.y, v.co.z)
pg_insert += ');'