Re: A dynamic SQL/ecpg question

From: Christof Petig <christof(at)petig-baender(dot)de>
To: Murphy Pope <pope_murphy(at)hotmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: A dynamic SQL/ecpg question
Date: 2002-04-01 20:30:55
Message-ID: 3CA8C37F.4000607@petig-baender.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Murphy Pope wrote:
> Can anyone explain the difference between the following descriptor members?
>
>
>
> LENGTH
>
> OCTET_LENGTH
>
> RETURNED_LENGTH
>
> RETURNED_OCTET_LENGTH
>
>
>
> From looking at the source code, the last two are identical and it
> looks like they return the length of an individual row/column value
> (i.e. for a varchar column, they would return the length of an actual
> varchar value).
>
>
>
> I think OCTET_LENGTH will return the size of the column as stored in the
> database.
>
>
>
> I can't quite figure out what LENGTH is supposed to do. It returns
> PQfmod( ) - VARHDRSZ. How is that different from the OCTET_LENGTH?

The problem is with pgsql's frontend/backend protocol (libpq). You only
get these two values, and I can't imagine a query which gives the
requested values. So you can't get/set any sensible values for two of them.
Christof

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message jacques.talbot 2002-04-03 14:45:36 Symbol main in ./libpgtcl.so is not defined
Previous Message Paul M Foster 2002-03-31 22:15:50 Return value if table doesn't exist