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

Changing parameters in your programs

PostgreSQL allows you to set some parameter settings for each session or for each transaction.

How to do it...

You can change the value of a setting during your session, such as the following:

SET work_mem = '16MB';

This value will then be used for every future transaction. You can also change it only for the duration of the "current transaction"

SET LOCAL work_mem = '16MB';

The setting will last until or if you issue the following:

RESET work_mem;

or

RESET ALL;

SET and RESET are SQL commands that can be issued from any interface. They apply only to PostgreSQL server parameters, by which we mean parameters that affect the server, but not necessarily the whole server. There may be other parameters, such as JDBC ...

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