Unix Technical Forum

Getting bind variables from log file

This is a discussion on Getting bind variables from log file within the pgsql Admins forums, part of the PostgreSQL category; --> Hi, PG 8.1.4 O/S Solaris 8 I was wondering whether it's possible to get the value of the bind ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 06:51 AM
Nigel Bishop
 
Posts: n/a
Default Getting bind variables from log file

Hi,



PG 8.1.4

O/S Solaris 8



I was wondering whether it's possible to get the value of the bind
variables in the PG log file



We have an app that's failing:



2006-11-15 12:50:15 GMTSTATEMENT: BEGIN

2006-11-15 12:50:15 GMTLOG: 00000: statement: PREPARE <unnamed> AS
SELECT displayname, stringvalue, datatype, siteid, datereceived,

file, intvalue FROM file_head INNER JOIN file_body USING (fileid) INNER
JOIN metric_references USING (reference) WHERE datereceived

BETWEEN DATE $1 AND DATE $2 AND siteid IN ($3) AND reference IN ($4)
ORDER BY datereceived, displayname, file, siteid

2006-11-15 12:50:15 GMTLOCATION: exec_parse_message, postgres.c:1153

2006-11-15 12:50:15 GMTSTATEMENT: SELECT displayname, stringvalue,
datatype, siteid, datereceived, file, intvalue FROM file_head IN

NER JOIN file_body USING (fileid) INNER JOIN metric_references USING
(reference) WHERE datereceived BETWEEN DATE $1 AND DATE $2 AND

siteid IN ($3) AND reference IN ($4) ORDER BY datereceived,
displayname, file, siteid

2006-11-15 12:50:15 GMTDEBUG: 00000: StartTransactionCommand

2006-11-15 12:50:15 GMTLOCATION: start_xact_command, postgres.c:1983

2006-11-15 12:50:15 GMTSTATEMENT: SELECT displayname, stringvalue,
datatype, siteid, datereceived, file, intvalue FROM file_head IN

NER JOIN file_body USING (fileid) INNER JOIN metric_references USING
(reference) WHERE datereceived BETWEEN DATE $1 AND DATE $2 AND

siteid IN ($3) AND reference IN ($4) ORDER BY datereceived,
displayname, file, siteid

2006-11-15 12:50:15 GMTERROR: 42601: syntax error at or near "$1" at
character 211

2006-11-15 12:50:15 GMTLOCATION: yyerror, scan.l:770

2006-11-15 12:50:15 GMTSTATEMENT: SELECT displayname, stringvalue,
datatype, siteid, datereceived, file, intvalue FROM file_head IN

NER JOIN file_body USING (fileid) INNER JOIN metric_references USING
(reference) WHERE datereceived BETWEEN DATE $1 AND DATE $2 AND

siteid IN ($3) AND reference IN ($4) ORDER BY datereceived,
displayname, file, siteid

2006-11-15 12:50:15 GMTDEBUG: 00000: StartTransactionCommand

2006-11-15 12:50:15 GMTLOCATION: start_xact_command, postgres.c:1983

2006-11-15 12:50:15 GMTDEBUG: 00000: StartTransaction



Running the SQL at the prompt is fine using the date format 'YYYY-MM-DD'



I set the following params in the conf file and although if kicks out a
lot of info it doesn't show the values for the bind variables



client_min_messages = debug5

log_min_messages = debug5

log_error_verbosity = verbose

log_min_error_statement = debug5

log_min_duration_statement = 0

log_statement = 'all'



Can someone point out where I'm going wrong?



Thanks,



Nigel







Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes.

Unless otherwise agreed expressly in writing, this communication is to betreated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation.

ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:49 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com