Re: Log Unique Queries without Params?

Поиск
Список
Период
Сортировка
От Chris Morris
Тема Re: Log Unique Queries without Params?
Дата
Msg-id CALrUc2WhM9PAivNNYdvSx83BOavEw6fN=mBA7R+xYa0nuqrf6Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Log Unique Queries without Params?  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Log Unique Queries without Params?
Список pgsql-general
Thx! 

On Sat, Apr 11, 2020 at 11:55 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
On Sun, Apr 12, 2020 at 6:51 AM Chris Morris <chris@mysteryscience.com> wrote:
>
> I have a local script I've written that will scan a log of PG queries to extract out unique queries without any specific parameter data. For example, if these 2 queries are actually run:
>
> SELECT * FROM foo where bar = 1;
> SELECT * FROM foo where bar = 2;
>
> It will capture only:
>
> SELECT * FROM foo whee bar = :id;
>
> Are there any existing tools that do this already for me? I'm considering setting up a server that can have logs forwarded to it and only logging unique queries like this, but I don't want to build anything that may already exist out there.

pgbadger (http://pgbadger.darold.net/#about) will do that and much
more.  Depending on what you want to achieve maybe pg_stat_statements
(https://www.postgresql.org/docs/current/pgstatstatements.html) is
also an alternative.

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

Предыдущее
От: AC Gomez
Дата:
Сообщение: Database lock on command: GRANT ALL PRIVILEGES ON ALL TABLES INSCHEMA, while looping though schemas
Следующее
От: Rene Romero Benavides
Дата:
Сообщение: Re: Log Unique Queries without Params?