RE: How to get the content of Bind variables

From: ROS Didier <didier(dot)ros(at)edf(dot)fr>
To: "MichaelDBA(at)sqlexec(dot)com" <MichaelDBA(at)sqlexec(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: RE: How to get the content of Bind variables
Date: 2019-02-28 12:47:02
Message-ID: 02aa1d9b33534f0eb56ac39dfcb91b73@PCYINTPEXMU001.NEOPROD.EDF.FR
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi
Thanks for the answer.

I have in my postgresql.conf :
log_min_duration_statement=0
and the content of bind variables is not showed in the log file.
What can I do to get the content of the bind variables ?

Best Regard
[cid:image002(dot)png(at)01D14E0E(dot)8515EB90]

Didier ROS
Expertise SGBD
EDF - DTEO - DSIT - IT DMA
Département Solutions Groupe
Groupe Performance Applicative
32 avenue Pablo Picasso
92000 NANTERRE

didier(dot)ros(at)edf(dot)fr<mailto:didier(dot)ros(at)edf(dot)fr>
Tél. : +33 6 49 51 11 88
[cid:image003(dot)png(at)01D4BE20(dot)1EAF68B0]<mailto:prenom(dot)nom(at)edf(dot)fr>[cid:image004(dot)png(at)01D4BE20(dot)1EAF68B0]<sip:prenom(dot)nom(at)edf(dot)fr>

De : MichaelDBA(at)sqlexec(dot)com [mailto:MichaelDBA(at)sqlexec(dot)com]
Envoyé : jeudi 28 février 2019 13:37
À : ROS Didier <didier(dot)ros(at)edf(dot)fr>
Cc : pgsql-performance(at)postgresql(dot)org
Objet : Re: How to get the content of Bind variables

If you set log_min_duration_statement low enough for your particular query, you will see another line below it showing what values are associated with each bind variable like this:
2019-02-28 00:07:55 CST 2019-02-28 00:02:09 CST ihr2 10.86.42.184(43460) SELECT LOG: duration: 26078.308 ms execute <unnamed>: select pg_advisory_lock($1)
2019-02-28 00:07:55 CST 2019-02-28 00:02:09 CST ihr2 10.86.42.184(43460) SELECT DETAIL: parameters: $1 = '3428922050323511872'

Regards,
Michael Vitale

ROS Didier<mailto:didier(dot)ros(at)edf(dot)fr>
Thursday, February 28, 2019 7:21 AM
Hi
In the log file of my PostgreSQL cluster, I find :
>>
Statement: update t_shared_liste_valeurs set deletion_date=$1, deletion_login=$2, modification_date=$3, modification_login=$4, administrable=$5, libelle=$6, niveau=$7 where code=$8
<<

è how to get the content of the bind variables ?

Thanks in advance

Best Regards
[cid:image002(dot)png(at)01D14E0E(dot)8515EB90]

Didier ROS
Expertise SGBD
EDF - DTEO - DSIT - IT DMA
Département Solutions Groupe
Groupe Performance Applicative
32 avenue Pablo Picasso
92000 NANTERRE

didier(dot)ros(at)edf(dot)fr<mailto:didier(dot)ros(at)edf(dot)fr>
Tél. : +33 6 49 51 11 88
[cid:image003(dot)png(at)01D4BE20(dot)1EAF68B0]<mailto:prenom(dot)nom(at)edf(dot)fr>[cid:image004(dot)png(at)01D4BE20(dot)1EAF68B0]<sip:prenom(dot)nom(at)edf(dot)fr>

Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.

Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Fd Habash 2019-02-28 13:34:54 RE: What is pg_stat_user_tables Showing NULL for last_autoanalyze &last_autovacuum
Previous Message MichaelDBA 2019-02-28 12:36:56 Re: How to get the content of Bind variables