Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-27 Thread Pavel Stehule
Hello 2008/7/28 Milan Oparnica <[EMAIL PROTECTED]>: > Pavel Stehule wrote: >> >> Hello >> >> this is near my implemenation of stored procedures - it's not far from >> your view on prepared statements. There result of any unbound select >> is directly forwarded to client - there is little bit diff

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-27 Thread chester c young
> > 2. perhaps "global" could mean simply that > the definition is global - if called for session and not > exist in session, then session prepares it first from the > global def. there would need to be a back reference in > case the global def was changed or dropped. > > > > Yes, this seems to

Re: [SQL] Re: Efficiently determining the number of bits set in the contents of, a VARBIT field

2008-07-27 Thread Jean-David Beyer
TJ O'Donnell wrote: > I use a c function, nbits_set that will do what you need. > I've posted the code in this email. > > TJ O'Donnell > http://www.gnova.com > > #include "postgres.h" > #include "utils/varbit.h" > > Datum nbits_set(PG_FUNCTION_ARGS); > PG_FUNCTION_INFO_V1(nbits_set); > Datum >

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-27 Thread Milan Oparnica
Pavel Stehule wrote: Hello this is near my implemenation of stored procedures - it's not far from your view on prepared statements. There result of any unbound select is directly forwarded to client - there is little bit different syntax, but idea is same create procedure foo(params) as $$ be

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-27 Thread Milan Oparnica
chester c young wrote: 1. like the idea because right now I'm having to track which prepared statement (sets) are in which session. using xcache to track this, but little bit dangerous. could query the database first but the whole idea is to take a load off the db. Thnx for support. The w

[SQL] Re: Efficiently determining the number of bits set in the contents of, a VARBIT field

2008-07-27 Thread TJ O'Donnell
I use a c function, nbits_set that will do what you need. I've posted the code in this email. TJ O'Donnell http://www.gnova.com #include "postgres.h" #include "utils/varbit.h" Datum nbits_set(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(nbits_set); Datum nbits_set(PG_FUNCTION_ARGS) { /* how many bi