some ideas from users

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема some ideas from users
Дата
Msg-id CAFj8pRDKBLyfRD1L5GVxiP8xnFs0BR2JFzc-r3Vswth5c7yuWA@mail.gmail.com
обсуждение исходный текст
Ответы Re: some ideas from users  (Marko Tiikkaja <marko@joh.to>)
Re: some ideas from users  (Andrew Dunstan <andrew@dunslane.net>)
Список 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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Turning recovery.conf into GUCs
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: some ideas from users