Skip to content

Instantly share code, notes, and snippets.

@debuggerpk
Created January 21, 2016 20:19
Show Gist options
  • Select an option

  • Save debuggerpk/6f8b2b9e8e6039f011e2 to your computer and use it in GitHub Desktop.

Select an option

Save debuggerpk/6f8b2b9e8e6039f011e2 to your computer and use it in GitHub Desktop.
correct pg_dump for amazon rds
SELECT exec('ALTER TABLE ' || quote_ident(s.nspname) || '.' || quote_ident(s.relname) || ' OWNER TO rds_superuser;')
FROM (
SELECT nspname, relname
FROM pg_class c JOIN pg_namespace n ON (c.relnamespace = n.oid)
WHERE nspname in ('tiger','topology') AND
relkind IN ('r','S','v') ORDER BY relkind = 'S')
s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment