Database Reference
In-Depth Information
proxy1=# GRANT USAGE ON FOREIGN SERVER
messaging TO bob;
GRANT
Note
More info on SQL/MED as implemented in PostgreSQL can be found at ht-
tp://www.postgresql.org/docs/current/static/sql-createforeigndatawrapper.html .
Moving data from the single to the partitioned
database
If you can schedule some downtime and your new partition databases are as big as
your original single database, the easiest way to partition the data is to make a full
copy of each of the nodes and then simply delete the rows that do not belong to the
partition:
pg_dump chap9 | psql p0
psql p0 -c 'delete from message where
hashtext(to_user) & 3 <> 0'
psql p0 -c 'delete from user_info where
hashtext(username) & 3 <> 0'
Repeat this for partitions p1 to p3 , each time deleting rows which don't match the
partition number ( psql chap9p1 -c 'delete … & 3 <> 1 ).
Note
Remember to vacuum when you are finished deleting the rows. PostgreSQL will
leave the dead rows in the data tables, so do a little maintenance while you have
some downtime.
Search WWH ::




Custom Search