Skip to content

Instantly share code, notes, and snippets.

@ureyes84
ureyes84 / change_db_owner.sh
Last active October 12, 2024 15:12 — forked from gingerlime/change_db_owner.sh
Postgresql - Changing ownership on all tables
#!/bin/bash
usage() {
cat << EOF
usage: $0 options
This script sets ownership for all tables, sequences, views and enum types for a given database.
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
Also merged changes from @sharoonthomas