some ideas from users

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: some ideas from users
Date: 2014-11-22 11:20:18
Message-ID: CAFj8pRDKBLyfRD1L5GVxiP8xnFs0BR2JFzc-r3Vswth5c7yuWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I did a week training and here are some ideas from people, who are starting
with Postgres.

1. possibility to set server side variables simply as psql option.
Motivation - more simple and natural changing datestyle for psql in shell
scripts. "--set" is allocated now, but theoretically we can use any unknown
long option as server side session variable.

echo "select ..." | psql --datestyle=YMD --enable_seqscan=off

2. missing table function with all settings. Like SHOW ALL, but with
filtering possibility

It should not be difficult:

CREATE OR REPLACE FUNCTION public.settings(OUT name text, OUT setting text,
OUT description text)
RETURNS SETOF record
LANGUAGE plpgsql
AS $function$
BEGIN
RETURN QUERY EXECUTE 'SHOW ALL'
RETURN;
END;
$function$

Usage:

postgres=# select * from settings() where name like '%checkpoint%';
name | setting
|
description
------------------------------+---------+------------------------------------------------------------------------------------------
checkpoint_completion_target | 0.5 | Time spent flushing dirty buffers
during checkpoint, as fraction of checkpoint interval.
checkpoint_segments | 3 | Sets the maximum distance in log
segments between automatic WAL checkpoints.
checkpoint_timeout | 5min | Sets the maximum time between
automatic WAL checkpoints.
checkpoint_warning | 30s | Enables warnings if checkpoint
segments are filled more frequently than this.
log_checkpoints | off | Logs each checkpoint.
(5 rows)

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2014-11-22 11:24:04 Re: some ideas from users
Previous Message Amit Kapila 2014-11-22 04:22:06 Re: Turning recovery.conf into GUCs