On Sep 16, 10:50 pm, Jeremy Evans <[email protected]> wrote:
> On Sep 16, 4:21 pm, Joe Van Dyk <[email protected]> wrote:
>
> > So there's no need to use the __type names anymore?
>
> There shouldn't be.
>
> > I'm still a little confused.
>
> >http://www.postgresql.org/docs/9.0/static/sql-prepare.htmlusesthe
> > 'prepare' and 'execute' statements.
>
> > Whereas when I use Sequel with
> >   DB[:orders]
> >     filter(:email_address => :$email).
> >     prepare(:select, :select_by_email)
> >   DB.call(:select_by_email, :email => '[email protected]')
>
> > In the postgresql logs, I see a 'parse', then a 'bind' and an
> > 'execute'.  I don't see a 'prepare' statement in there.  Should I?
>
> I'm not sure exactly what the PostgreSQL logs show for prepared
> statements, but a parse sounds like a prepare, and bind/execute should
> be when you execute.  If you are using the pg as the underlying driver
> for the postgres adapter, it should definitely use pg's prepare and
> exec_prepared.

When I execute the following sql:

tanga_dev=# prepare fancy(text) as select id from orders where
email_address = $1;
PREPARE
tanga_dev=# execute fancy('[email protected]');
 id
----
(0 rows)

tanga_dev=# execute fancy('[email protected]');
 id
----
(0 rows)



This is what I see in the logs:

LOG:  duration: 1.877 ms  statement: prepare fancy(text) as select id
from orders where email_address = $1;
LOG:  duration: 0.229 ms  statement: execute fancy('[email protected]');
DETAIL:  prepare: prepare fancy(text) as select id from orders where
email_address = $1;
LOG:  duration: 0.191 ms  statement: execute fancy('[email protected]');
DETAIL:  prepare: prepare fancy(text) as select id from orders where
email_address = $1;


I don't see any parse or binds in there.

Maybe this is a pg gem question?

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to