Re: TODO Item - Return compressed length of TOAST datatypes

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: TODO Item - Return compressed length of TOAST datatypes
Date: 2005-06-19 05:47:55
Message-ID: 42B5070B.9010900@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

The next iteration -

Hopefully I have got the idea basically right.

I wonder if I have done the "am I a varlena" the long way.., pls advise
if so!

Cheers

Mark

Tom Lane wrote:
>
> 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 ...
>
> 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.
>
>

Attachment Content-Type Size
pg_toast_compressed_length-2.patch text/plain 5.6 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Thomas F. O'Connell 2005-06-19 06:07:20 Re: [PATCHES] default database creation with initdb
Previous Message Bruce Momjian 2005-06-19 01:06:16 Re: Typo in pl_funcs.c comment