Thread: About debugging trigger
<div class="Section1"><p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12.0pt">Hi,<br /><br /> I have a question about how to insert standard output statement in trigger for debugging purpose.<br /><br /> I have tried using the following:</span></font><ul type="disc"><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">echo 'show debug message' ;</span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">echo "show debug message" ; </span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">print("show debug message");</span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">print('show debug message');</span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">dbms_output.put_line('show debug message');</span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l0 level1 lfo1"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">dbms_output.put_line("show debug message");</span></font></ul><p class="MsoNormal"><fontface="Times New Roman" size="3"><span style="font-size: 12.0pt">However, I got the following error message: </span></font><ul type="disc"><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo2"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">ERROR: syntax error at or near "echo" at character 1<br /> QUERY: echo 'show debugmessage'</span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1level1 lfo2"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">ERROR: syntax error at or near"print" at character 1<br /> QUERY: print('show debug message') </span></font><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo2"><font face="Times New Roman" size="3"><spanstyle="font-size:12.0pt">ERROR: syntax error at or near "dbms_output" at character 1<br /> QUERY: dbms_output.put_line("showdebug message")</span></font></ul><p class="MsoNormal"><font face="Times New Roman" size="3"><spanstyle="font-size: 12.0pt"><br /> I know that in Oracle, the way to insert standard output statement in trigger is using dbms_output.put_line()method, but it doesn't seem to work in pgadmin. <br /><br /> I have already checked the frequentlyasked questions list as well as the pgAdmin documentation for a solution and I also have tried searching Google,however I can not find a solution for it. Please help when you get a chance! <br /><br /> Thank you in advance,</span></font><pclass="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12.0pt"> </span></font><p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12.0pt">Michael</span></font><font face="Arial" size="2"><span style="font-size: 10.0pt;font-family:Arial"></span></font></div>
In Postgresql it's
RAISE NOTICE 'Your Message Goes Here %', value_to _replace%_must_be_text_or_varchar;
Please note, this is not a question for PgAdmin. It should go to pgsql-general@postgresql.org
From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Michael Su
Sent: Tuesday, November 07, 2006 11:59 AM
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] About debugging trigger
Hi,
I have a question about how to insert standard output statement in trigger for debugging purpose.
I have tried using the following:
- echo 'show debug message' ;
- echo "show debug message" ;
- print("show debug message");
- print('show debug message');
- dbms_output.put_line('show debug message');
- dbms_output.put_line("show debug message");
However, I got the following error message:
- ERROR: syntax error at or near "echo" at character 1
QUERY: echo 'show debug message' - ERROR: syntax error at or near "print" at character 1
QUERY: print('show debug message') - ERROR: syntax error at or near "dbms_output" at character 1
QUERY: dbms_output.put_line("show debug message")
I know that in Oracle, the way to insert standard output statement in trigger is using dbms_output.put_line() method, but it doesn't seem to work in pgadmin.
I have already checked the frequently asked questions list as well as the pgAdmin documentation for a solution and I also have tried searching Google, however I can not find a solution for it. Please help when you get a chance!
Thank you in advance,
Michael