mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user