"Morgan Kita" <mkita@verseon.com> writes:
> So what could be going on here?
There's nothing obviously wrong in what you posted ... other than the
very poor style of misspelling "VARHDRSZ" as "4", not using VARDATA and
VARATT_SIZEP macros, and generally doing your best to ignore every one
of the portability conventions that are built into the Postgres
sources. This code *will* break at some point in the future, but
it's not immediately obvious why it's not broken on a typical
present-day 32-bit-Intel platform. (Now if that's not what you are
running on, maybe you should mention it...)
When there's nothing broken in what you're looking at, that's usually a
good sign that the problem is elsewhere. Could you post a complete
non-working example rather than just extracts?
regards, tom lane