Skip site navigation (1) Skip section navigation (2)

Re: feature request - datum_compute_size and datum write_should be public

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, heikki(dot)linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: feature request - datum_compute_size and datum write_should be public
Date: 2012-02-02 01:07:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 array into a function and have the function tell me exactly how much space that would require on-disk. It's pretty easy to figure that out for things like varchar and numeric, but doing so for arrays or composite types requires pretty detailed knowledge 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(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2012-02-02 01:30:18
Subject: Re: Progress on fast path sorting, btree index creation time
Previous:From: Alvaro HerreraDate: 2012-02-02 01:01:27
Subject: heap_tuple_needs_freeze false positive

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group