| 101 | {{{ |
| 102 | SELECT d.datname AS Name, pg_catalog.pg_get_userbyid(d.datdba) AS Owner, |
| 103 | CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') |
| 104 | THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) |
| 105 | ELSE 'No Access' |
| 106 | END AS SIZE |
| 107 | FROM pg_catalog.pg_database d |
| 108 | ORDER BY |
| 109 | CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') |
| 110 | THEN pg_catalog.pg_database_size(d.datname) |
| 111 | ELSE NULL |
| 112 | END DESC -- nulls first |
| 113 | LIMIT 20 |
| 114 | }}} |
| 115 | |
| 116 | | table_name | size | |
| 117 | | eda2|10 GB| |
| 118 | |eda2.1|3305 MB| |
| 119 | |
| 120 | |
| 121 | ---------------------- |
| 122 | = CREATE database EDA2.0 on the new postgres 9.6 server = |
| 123 | |
| 124 | {{{ |
| 125 | createdb -U postgres -h 1.100.1.6 eda2.0 |
| 126 | psql -d eda2.0 -h 1.100.1.6 -p 5434 --c "CREATE EXTENSION postgis;" |
| 127 | psql -d eda2.0 -h 1.100.1.6 -p 5434 -c "CREATE EXTENSION postgis_topology;" |
| 128 | }}} |
| 129 | >>If you plan to restore an old backup from prior versions in this new db, run: |
| 130 | >> psql -d [yourdatabase] -f legacy.sql |
| 131 | >>You can later run uninstall_legacy.sql to get rid of the deprecated functions after you are done with restoring and cleanup. |
| 132 | > Let's see if that works before |
| 133 | |
| 134 | The .bat file, change schema and backupfile |
| 135 | {{{ |
| 136 | set PGPORT=5432 |
| 137 | set PGHOST=1.100.1.6 |
| 138 | set PGUSER=postgres |
| 139 | set PGPASSWORD=supersecret |
| 140 | set THEDBSOURCE=eda2 |
| 141 | set THEDEBDESTINATION=eda2.0 |
| 142 | set PGHOST=1.100.1.6 |
| 143 | set BACKUPFILE=anglian.backup |
| 144 | set SCHEMA = anglian |
| 145 | set PGINSTALL=C:\Program Files\PostgreSQL\9.6 |
| 146 | set PATH=%PATH%;"%PGINSTALL%\bin" |
| 147 | pg_dump --schema %SCHEMA% --file %BACKUPFILE% --verbose -Fc -b %THEDBSOURCE% |
| 148 | set PGPORT=5434 |
| 149 | perl "%PGINSTALL%\utils\postgis_restore.pl" "%BACKUPFILE%" | psql %THEDB% 2> errors.txt |
| 150 | }}} |
| 151 | |
| 152 | |
| 153 | |
| 154 | list schema |
| 155 | {{{#!sh |
| 156 | psql -U postgres -h w3.eptb-vilaine.fr eda2 |
| 157 | eda2=# \dn |
| 158 | }}} |
| 159 | |
| 160 | anglian |
| 161 | bd_map |
| 162 | belge |
| 163 | ccm21 |
| 164 | clc |
| 165 | dbeel |
| 166 | dbeel_nomenclature |
| 167 | dmeer2003 |
| 168 | ecoregion2003 |
| 169 | europe |
| 170 | european_wise2008 |
| 171 | france |
| 172 | geobs2010 |
| 173 | ia |
| 174 | ireland |
| 175 | onema |
| 176 | oria |
| 177 | public |
| 178 | temperature |
| 179 | tidal |
| 180 | uga2010 |
| 181 | uk |
| 182 | vilaine |
| 183 | wrbd |