title: Best way to change the owner of a PostgreSQL database and their tables?
body: <p>I am trying to change the owner of a PostgreSQL database (version > 8.2) and its tables.</p>
  
  <p>I read this solution:</p>
  
  <p><a href="https://stackoverflow.com/questions/1348126/modify-owner-on-all-tables-simultaneously-in-postgresql">Modify OWNER on all tables simultaneously in PostgreSQL</a></p>
  
  <p>But is this the best way to do it (for recent versions of PostgreSQL)?. It seems that there is a function REASSIGN OWNED which is better, but this one changes every database owned by the <em>old_role</em>, doesn't it? I only want it for one database.</p>
  
  <p>Like this post:</p>
  
  <p><a href="https://stackoverflow.com/questions/16959764/reassign-owned-by-for-1-specified-database">REASSIGN OWNED BY for 1 specified database</a></p>
  
  <p>I am not going to change the owner postgres, which is the best way nowadays?</p>
  
  <p>Thank you in advance</p>