Re: A dynamic SQL/ecpg question - Mailing list pgsql-interfaces

From Christof Petig
Subject Re: A dynamic SQL/ecpg question
Date
Msg-id 3CA8C37F.4000607@petig-baender.de
Whole thread Raw
In response to A dynamic SQL/ecpg question  ("Murphy Pope" <pope_murphy@hotmail.com>)
List 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




pgsql-interfaces by date:

Previous
From: Paul M Foster
Date:
Subject: Return value if table doesn't exist
Next
From: jacques.talbot@muhc.mcgill.ca
Date:
Subject: Symbol main in ./libpgtcl.so is not defined