Re: How to get the content of Bind variables

2019-03-01 Thread Laurenz Albe
ROS Didier wrote:
> Here is a biggest part of my log file :
> 
>  2019-02-27 14:41:28 CET [16239]: [5696-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainLOG:  
> duration: 1.604 ms
> 2019-02-27 14:41:28 CET [16239]: [5697-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainLOG:  
> duration: 0.084 ms  parse : 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
> 2019-02-27 14:41:28 CET [16239]: [5698-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainLOG:  
> plan:
> 2019-02-27 14:41:28 CET [16239]: [5699-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainSTATEMENT:
>   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
> 2019-02-27 14:41:28 CET [16239]: [5700-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainLOG:  
> duration: 0.288 ms  bind : 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
> 2019-02-27 14:41:28 CET [16239]: [5701-1] [10086] 
> user=pgbd_preint_sg2,db=pgbd_preint_sg2,client=localhost.localdomainLOG:  
> execute : 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
> <<
> The statement has been executed
> It is the same problem for all the statements.
> I can not get the content of the bind variables.

You should set "log_error_verbosity" back from "terse" to "default".
Then you will see the DETAIL messages.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




Re: How to get the content of Bind variables

2019-03-01 Thread Tom Lane
ROS Didier  writes:
> postgres=# show log_error_verbosity ;
>  log_error_verbosity
> -
>  default
> (1 row)

So ... how old is this server?  AFAIK the above should be enough to ensure
you get the DETAIL lines with parameter values.  But the ability to log
those hasn't been there forever.

regards, tom lane



RE: How to get the content of Bind variables

2019-03-01 Thread ROS Didier
Hi Tom

Thanks a lot for your answer.

*) Here is information about my server :
[postgres@noeyypvd pg_log]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

postgres=# select version() ;
 version
-
 PostgreSQL 10.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 
(Red Hat 4.8.5-16), 64-bit
(1 row)

  *)  it's very problematic that we can not get the content of bind variables. 
We can not determine the root query which makes UPDATE statements to crash our 
production database.
What can explain the lack of information about bind variables?

*) Here is the parameters setting I use :
# postgresql.conf : include_if_exists = 
'/appli/postgres/pgbd_prod_pda/10/conf/audit.conf'

log_rotation_size = 0
log_destination=stderr
logging_collector=true
client_min_messages=notice
log_min_messages=ERROR
log_min_error_statement=ERROR
log_min_duration_statement=250
debug_print_parse=off
debug_print_rewritten=off
debug_print_plan=on
debug_pretty_print=on
log_checkpoints=on
log_connections=on
log_disconnections=on
log_duration=on
log_error_verbosity=VERBOSE
log_hostname=on
log_lock_waits=on
deadlock_timeout=1s
log_statement=all
log_temp_files=0
log_autovacuum_min_duration = 0
track_activities=on
track_io_timing=on
track_functions=all
log_line_prefix = '%t [%p]: [%l-1] [%x] user=%u,db=%d,client=%h'
lc_messages ='C'
shared_preload_libraries = 'passwordcheck,pg_stat_statements,pgstattuple'
listen_addresses = '*'
pg_stat_statements.track=all
pg_stat_statements.max = 1000
pg_stat_statements.track_utility=on
pg_stat_statements.save=on
   
*) -> suggestion : It would be nice to have the content of bind variable of a 
query in a table of  pg_catalog. (cf ORACLE) 

Didier ROS
Expertise SGBD
EDF - DTEO - DSIT - IT DMA
Département Solutions Groupe
Groupe Performance Applicative
32 avenue Pablo Picasso
92000 NANTERRE
 
[email protected]
Tél. : +33 6 49 51 11 88

-Message d'origine-
De : [email protected] [mailto:[email protected]] 
Envoyé : vendredi 1 mars 2019 17:30
À : ROS Didier 
Cc : [email protected]; [email protected]
Objet : Re: How to get the content of Bind variables

ROS Didier  writes:
> postgres=# show log_error_verbosity ;
>  log_error_verbosity
> -
>  default
> (1 row)

So ... how old is this server?  AFAIK the above should be enough to ensure you 
get the DETAIL lines with parameter values.  But the ability to log those 
hasn't been there forever.

regards, tom lane



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.




RE: How to get the content of Bind variables

2019-03-01 Thread legrand legrand
Hi Didier,

I imagine that this is the sql executed from a trigger.
Could you provide the trigger pl/pgsql code ? 
as the source and target tables (anonymized) definition ?

After a fresh db restart, are thoses logs the same for the 6 first
executions and the following ones ?

Regards
PAscal 



--
Sent from: 
http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html