Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 27CDD475E9D for ; Mon, 18 Nov 2002 11:19:35 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2DC20475E6F for ; Mon, 18 Nov 2002 11:19:34 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id gAIGJPhR029661; Mon, 18 Nov 2002 11:19:25 -0500 (EST) To: David Wheeler Cc: dbi-dev@perl.org, pgsql-interfaces@postgresql.org Subject: Re: DBD::PostgreSQL In-reply-to: <0907BA9A-FB11-11D6-93B3-0003931A964A@wheeler.net> References: <0907BA9A-FB11-11D6-93B3-0003931A964A@wheeler.net> Comments: In-reply-to David Wheeler message dated "Mon, 18 Nov 2002 08:16:03 -0800" Date: Mon, 18 Nov 2002 11:19:25 -0500 Message-ID: <29660.1037636365@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/51 X-Sequence-Number: 3299 David Wheeler writes: > On Sunday, November 17, 2002, at 10:15 PM, Tom Lane wrote: >> Both of these seem pretty bogus to me. Ideally the driver should not >> issue a "begin" until the application issues the first command of the >> new transaction. Otherwise you get into scenarios where idle >> connections are holding open transactions, and ain't nobody gonna be >> happy with that. > Okay. I think I'll use a flag in the driver to track when it's in a > transaction, and do the right thing in the begin and rollback functions. I think someone else said that the DBD framework already includes such a flag ("BegunWork"?) --- if so, you should surely use that one. > So, if I understand you correctly, PostgreSQL's PREPARE statement > *requires* data typing in its syntax? Yup. > If so, is there an > easy/straight-forward way to ask the server what the data types for > each column are before executing the PREPARE? There are various ways to retrieve the datatypes of the columns of a table, but I'm not sure how that helps you to determine the parameter types for an arbitrary SQL command to be prepared. Are you assuming a specific structure of the command you want to prepare? regards, tom lane