O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Performing actions on many tables

As a database administrator, you will often need to apply multiple commands as part of the same overall task. That is one of the following:

  • Many different actions on multiple tables
  • Same action, multiple tables
  • Same action, multiple tables, in parallel
  • Different actions, one on each table, in parallel

The first is the general case where you need to make a set of coordinated changes. The solution is "write a script" as we've already discussed. We can also call this static scripting, because you write the script manually, and then execute it.

The second type of task can be achieved very simply with dynamic scripts, where we write a script that writes a script. That technique is the main topic of this recipe.

Performing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required