diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-26 17:54:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-26 17:54:02 +0000 |
commit | 5cabcfccce4b8b826c9b30828f3012b7926a6946 (patch) | |
tree | 3e14c0710a45b4195734dd3189eb89eac4969073 /src/backend/commands/analyze.c | |
parent | 8009c275925dda90f1275ba70f5c2a63abaa520b (diff) |
Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align. This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator. By Joe Conway
and Tom Lane.
Diffstat (limited to 'src/backend/commands/analyze.c')
-rw-r--r-- | src/backend/commands/analyze.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index c7dbe44f780..0d3173e9b3e 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.43 2002/08/24 15:00:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.44 2002/08/26 17:53:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1731,7 +1731,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) numdatums[n] = Float4GetDatum(stats->stanumbers[k][n]); /* XXX knows more than it should about type float4: */ arry = construct_array(numdatums, nnum, - false, sizeof(float4), 'i'); + FLOAT4OID, + sizeof(float4), false, 'i'); values[i++] = PointerGetDatum(arry); /* stanumbersN */ } else @@ -1767,7 +1768,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats) } /* XXX knows more than it should about type text: */ arry = construct_array(txtdatums, ntxt, - false, -1, 'i'); + TEXTOID, + -1, false, 'i'); values[i++] = PointerGetDatum(arry); /* stavaluesN */ } else |