Re: TODO Item - Return compressed length of TOAST datatypes

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: TODO Item - Return compressed length of TOAST datatypes
Date: 2005-06-19 00:16:38
Message-ID: 42B4B966.3010804@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Mark Kirkwood <markir(at)paradise(dot)net(dot)nz> writes:
>
>>I thought I would have a look at:
>>(Datatypes) Add function to return compressed length of TOAST data values.
>
>
> My recollection of that discussion is that we just wanted something
> that would return the actual VARSIZE() of the datum. You're building
> something way too confusing ...
>

I was guessing a little about exactly what was wanted - for some reason
I couldn't access the mail archives for the last few days (however,
can now).

> A more interesting point is that the way you've declared the function,
> it will only work on text values, which is pretty limiting. Ideally
> we'd define this thing as "pg_datum_length(any-varlena-type) returns int"
> but there is no pseudotype corresponding to "any varlena type".
>
> I was thinking about this the other day in connection with my proposal
> to make something that could return the TOAST value OID of an
> out-of-line datum. I think the only non-restrictive way to do it would
> be to declare the function as taking "any", and then add a runtime check
> using the get_fn_expr_argtype() mechanism to test that what you've been
> given is in fact a varlena datatype.
>

Yes - was thinking I needed to check if the Datum was a varlena (and
didn't know how to do it...), so thanks for the pointer!

With these thoughts in mind, I'll have another go :-)

Cheers

Mark

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2005-06-19 00:32:10 Re: buildfarm notifications
Previous Message Andreas Pflug 2005-06-18 23:23:04 Re: [PATCHES] default database creation with initdb