Re: feature request - datum_compute_size and datum write_should be public - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: feature request - datum_compute_size and datum write_should be public
Date
Msg-id 1328144828-sup-2169@alvh.no-ip.org
Whole thread Raw
In response to Re: feature request - datum_compute_size and datum write_should be public  (Jim Nasby <jim@nasby.net>)
Responses Re: feature request - datum_compute_size and datum write_should be public  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Excerpts from Jim Nasby's message of mié feb 01 20:47:05 -0300 2012:

> I'm not certain this in what  Pavel is referring to, but I have often wished that I could pass something like an
arrayinto a function and have the function tell me exactly how much space that would require on-disk. It's pretty easy
tofigure that out for things like varchar and numeric, but doing so for arrays or composite types requires pretty
detailedknowledge of PG internals. 

I think you can just use pg_column_size on a composite datum (such as a
ROW() construct) and it will give you the right number.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: heap_tuple_needs_freeze false positive
Next
From: Alvaro Herrera
Date:
Subject: Re: Progress on fast path sorting, btree index creation time