diff options
| author | Bruce Momjian | 2005-07-06 19:02:54 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2005-07-06 19:02:54 +0000 |
| commit | a9236028554ca0e11797c887373c1a34800a4fa6 (patch) | |
| tree | 58e500e5de9b36e88dbab01d73d208e20b30161e /src/include | |
| parent | b9cb1326481302719ad8bdad6b6247bca42a629b (diff) | |
Add pg_column_size() to return storage size of a column, including
possible compression.
Mark Kirkwood
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/tuptoaster.h | 10 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 6 | ||||
| -rw-r--r-- | src/include/utils/builtins.h | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h index 1cf3b4debe6..b45df277b1e 100644 --- a/src/include/access/tuptoaster.h +++ b/src/include/access/tuptoaster.h @@ -6,7 +6,7 @@ * * Copyright (c) 2000-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.22 2005/03/21 01:24:04 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.23 2005/07/06 19:02:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -138,4 +138,12 @@ extern Datum toast_compress_datum(Datum value); */ extern Size toast_raw_datum_size(Datum value); +/* ---------- + * toast_datum_size - + * + * Return the storage size of a varlena datum + * ---------- + */ +extern Size toast_datum_size(Datum value); + #endif /* TUPTOASTER_H */ diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 340052792f7..0a213f64be1 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.373 2005/07/01 19:19:03 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.374 2005/07/06 19:02:53 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -3658,6 +3658,10 @@ DESCR("current value from last used sequence"); DATA(insert OID = 2560 ( pg_postmaster_start_time PGNSP PGUID 12 f f t f s 0 1184 "" _null_ _null_ _null_ pgsql_postmaster_start_time - _null_ )); DESCR("postmaster start time"); +/* Column storage size */ +DATA(insert OID = 1269 ( pg_column_size PGNSP PGUID 12 f f t f i 1 23 "2276" _null_ _null_ _null_ pg_column_size - _null_ )); +DESCR("bytes required to store the value, perhaps with compression"); + /* new functions for Y-direction rtree opclasses */ DATA(insert OID = 2562 ( box_below PGNSP PGUID 12 f f t f i 2 16 "603 603" _null_ _null_ _null_ box_below - _null_ )); DESCR("is below"); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 37423dc73c2..fea496aaaea 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.258 2005/06/17 22:32:50 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.259 2005/07/06 19:02:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -601,6 +601,7 @@ extern Datum byteacat(PG_FUNCTION_ARGS); extern Datum byteapos(PG_FUNCTION_ARGS); extern Datum bytea_substr(PG_FUNCTION_ARGS); extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS); +extern Datum pg_column_size(PG_FUNCTION_ARGS); /* version.c */ extern Datum pgsql_version(PG_FUNCTION_ARGS); |
