Skip to content

Instantly share code, notes, and snippets.

@realsby
Created January 3, 2020 15:41
Show Gist options
  • Save realsby/463f5aecf100769ec11c393ebfeecdb1 to your computer and use it in GitHub Desktop.
Save realsby/463f5aecf100769ec11c393ebfeecdb1 to your computer and use it in GitHub Desktop.
Upgrade Postgresql 9.4 to 9.6 on Debian 9
sudo nano /etc/apt/sources.list
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo aptitude install postgresql-9.6
pg_lsclusters
sudo pg_dropcluster 9.6 main --stop
pg_lsclusters
sudo service postgresql status
sudo service postgresql stop
sudo pg_upgradecluster 9.4 main
sudo service postgresql start
check if the db is working then:
sudo pg_dropcluster --stop 9.4 main
@realsby
Copy link
Author

realsby commented Jan 3, 2020

select col.table_schema,
col.table_name,
col.ordinal_position as col_id,
col.column_name,
col.data_type,
col.numeric_precision,
col.numeric_scale
from information_schema.columns col
join information_schema.tables tab on tab.table_schema = col.table_schema
and tab.table_name = col.table_name
and tab.table_type = 'BASE TABLE'
where col.data_type LIKE '%json%'
and col.table_schema not in ('information_schema', 'pg_catalog')
order by col.table_schema,
col.table_name,
col.ordinal_position;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment