LVgamb00ler wrote:I have had the same problem as the original poster. My solution was to create a backup of the DB that was accidently in the wrong tablespace, then use pgAdmin to create another database in the correct tablespace, then restore the backup to the new DB.
I was wondering as I read the posts in this thread whether it would be possible to:
- create the desired tablespace
- copy the hard disk files to the desired tablespace retaining the same naming conventions as in the original storage location
- modify the row in pg_database (postgreSQL system catalog) to change the tablespace name
- delete DB files from original storage
Does anyone know how to write sql commands to access the postgreSQL system catalogs?
G'luck all,
LVgamb00ler
I am not sure if that would work or not. Running the SQL directly through pgAdmin III, you can access the system catalogs for the selected database the exact same way you would query any other table.
You can view all of the system tables and views by expending the "Catalogs" -> "PostgreSQL" tree.
Bets regards,
Derek