Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > Re: Re: BUG #40...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 3757 of 4031
Post > Topic >>

Re: Re: BUG #4053: libpq do***entation should express clearly, that integers are passed in network octet order

by mmoncure@[EMAIL PROTECTED] ("Merlin Moncure") May 8, 2008 at 12:44 PM

On Thu, May 8, 2008 at 12:27 PM, Bruce Momjian <bruce@[EMAIL PROTECTED]
> wrote:
> Andrew Chernow wrote:
>  > >>> This is exactly what libpqtypes solves.  Not only do we handle
>  > >>> formatting of binary formats, we provide a level of protection
from
>  > >>> internal format changes for libpq users.  See the example here:
>  > >>> http://libpqtypes.esilo.com/.
 So, do***entation of binary
formats
>  > >>> (including network byte ordering) are not required.
>  > >> No, it is still required. There's not a single reference to
libpqtypes
>  > >> in Postgres do***entation, and libpqtypes isn't part of the
distribution,
>  > >> if I understand it right.
>  > >
>  > > Agreed.
>  > >
>  >
>  > Correct, libpqtypes is not part of the core.
>  >
>  > What we are saying is, libpqtypes solves this problem.  I don't think
>  > docs is the solution because that just sup****ts the idea of libpq
apps
>  > directly handling binary formats; which makes changing these formats
>  > MUCH harder in future releases.  Lots of libpq apps would be
dependant
>  > on these binary formats.
>  >
>  > By all means, do***enting this is probably a good idea.  I just don't
>  > think it solves any of the interesting problems.
>
>  Agreed that libpqtypes would solve the problem, but the odd thing to me
>  is that we have gotten very few requests for binary format information
>  since we added binary prepared parameters years ago, so is no one
>  actually using it?

libpqtypes is safe to use right now if you are willing to patch libpq
yourself back to at least 8.2.  back to 7.4 is possible but some
internal formats may have changes (we didn't check back that far) so
you'd have to be a little careful.

If I searched the archives, I could probably come up with several
requests for do***entation/explanations on how to use the binary
format, with at least one or two other patches to do byteswapping.
Since libpqtypes automatically parameterizes your query and handles
all the details of byteswapping, why would you ever want to do it
another way?  What possible advantage would there be to ever invoking
PQexecParams manually? (PQexec has a small speed advantage for simple
queries, so that at least still has a place).

Add this to the fact that you now have a clean way to handle things
like arrays and composites without all the tedious and error prone
text parsing.  I understand arguments related to code maintenance and
the like, but for libpq developers, there would never be a reason
(outside of occasional PQexec), to run a non 'params' based query
because it's faster, easier, and safer.

It's a catch-22 here...a lot of people are simply unaware of what the
postgresql binary flag is even supposed to do, since it's so poorly
do***ented.  By the way, even with do***entation, any app relying on
binary formats without the protection of libpqtypes could suddenly and
spectacularly break since there is zero protection from binary format
changes.

merlin

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 6 Posts in Topic:
Re: BUG #4053: libpq documentation should express clearly,
bruce@[EMAIL PROTECTED]   2008-05-08 11:34:32 
Re: Re: BUG #4053: libpq documentation should express clearly,
ac@[EMAIL PROTECTED] (An  2008-05-08 11:57:09 
Re: Re: BUG #4053: libpq documentation should express
bruce@[EMAIL PROTECTED]   2008-05-08 12:27:01 
Re: Re: BUG #4053: libpq documentation should express clearly, t
mmoncure@[EMAIL PROTECTED  2008-05-08 12:44:50 
Re: Re: BUG #4053: libpq documentation should express clearly,
ac@[EMAIL PROTECTED] (An  2008-05-08 13:04:49 
Re: Re: BUG #4053: libpq documentation should express clearly, t
asau@[EMAIL PROTECTED] (  2008-05-08 20:17:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:36:48 CDT 2008.