X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EDC58D1B542 for ; Sun, 28 Sep 2003 20:14:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18794-02 for ; Sun, 28 Sep 2003 17:14:50 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 0EFA5D1B53E for ; Sun, 28 Sep 2003 17:14:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8SKEj6c010978; Sun, 28 Sep 2003 16:14:45 -0400 (EDT) To: "Dan Langille" Cc: pgsql-sql@postgresql.org Subject: Re: In-reply-to: <3F7706FC.13057.3006C804@localhost> References: <20030928151910.S78282@laptop.unixathome.org> <3F7706FC.13057.3006C804@localhost> Comments: In-reply-to "Dan Langille" message dated "Sun, 28 Sep 2003 16:06:20 -0400" Date: Sun, 28 Sep 2003 16:14:44 -0400 Message-ID: <10977.1064780084@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/370 X-Sequence-Number: 15348 "Dan Langille" writes: > However, the results are confusing. I'm getting the wrong number of > parameters. The value being returned appears to be the value > supplied. But the log results show an interesting pattern in the > number of selects being run. I dunno where the cast() queries are coming from, but note that they're not your SELECT. You are misunderstanding how the code works if you expect to see query LOG entries from plpgsql queries. For a non-EXECUTEd plpgsql command, log_statement will only show the query the first time it is executed in a session, because that log entry is generated as a side-effect of parsing and planning. As a means of tracing the execution of plpgsql functions, log_statement is pretty worthless :-(. I would like us to develop a full-up tracing and debugging facility for plpgsql, but we haven't got it yet. regards, tom lane