PQfmod and varchars

Поиск
Список
Период
Сортировка
От Shachar Shemesh
Тема PQfmod and varchars
Дата
Msg-id 4268BA34.9070303@shemesh.biz
обсуждение исходный текст
Список pgsql-hackers
Hi list,

I'm trying to find out, from a client, how many characters will fit in a 
varchar field 
(http://pgfoundry.org/tracker/index.php?func=detail&aid=1000286&group_id=1000085&atid=394). 
Problem is that when I do "PQfmod" on a varchar field defined as 
"varchar(20)", PQfmod returns "24".

Now, it's fairly easy for me to subtract 4 from each result I get from 
PQfmod, but I have a suspicion that this "4" is actually "pointer's 
length", which means that I need to detect a 64 bit server and subtract 
8 instead.

1. Is this suspicion correct?
2. If so, how do I detect how much to subtract.
3. If not, what is the meaning of "4"?

Thanks,         Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: slides on the optimizer
Следующее
От: Andrew - Supernews
Дата:
Сообщение: Re: PQfmod and varchars