mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Rename pg_attribute.attnvals to attdisbursion.
This commit is contained in:
parent
f1edf02cc1
commit
e482462960
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.15 1997/08/21 01:31:24 vadim Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.16 1997/08/21 03:01:15 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the executor utility code such as "ExecTypeFromTL" should be
|
* some of the executor utility code such as "ExecTypeFromTL" should be
|
||||||
@ -179,7 +179,7 @@ TupleDescInitEntry(TupleDesc desc,
|
|||||||
memset(att->attname.data,0,NAMEDATALEN);
|
memset(att->attname.data,0,NAMEDATALEN);
|
||||||
|
|
||||||
|
|
||||||
att->attnvals = 0; /* dummy value */
|
att->attdisbursion = 0; /* dummy value */
|
||||||
att->attcacheoff = -1;
|
att->attcacheoff = -1;
|
||||||
|
|
||||||
att->attnum = attributeNumber;
|
att->attnum = attributeNumber;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.19 1997/08/21 02:27:53 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.20 1997/08/21 03:01:21 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_creatr() - Create an uncataloged heap relation
|
* heap_creatr() - Create an uncataloged heap relation
|
||||||
@ -374,7 +374,7 @@ heap_creatr(char *name,
|
|||||||
* work? Is it automatic now? Expects the caller to have
|
* work? Is it automatic now? Expects the caller to have
|
||||||
* attname, atttypid, atttyparg, attproc, and attlen domains filled.
|
* attname, atttypid, atttyparg, attproc, and attlen domains filled.
|
||||||
* Create fills the attnum domains sequentually from zero,
|
* Create fills the attnum domains sequentually from zero,
|
||||||
* fills the attnvals domains with zeros, and fills the
|
* fills the attdisbursion domains with zeros, and fills the
|
||||||
* attrelid fields with the relid.
|
* attrelid fields with the relid.
|
||||||
*
|
*
|
||||||
* scan relation catalog for name conflict
|
* scan relation catalog for name conflict
|
||||||
@ -571,7 +571,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
|
|||||||
dpp = tupdesc->attrs;
|
dpp = tupdesc->attrs;
|
||||||
for (i = 0; i < natts; i++) {
|
for (i = 0; i < natts; i++) {
|
||||||
(*dpp)->attrelid = new_rel_oid;
|
(*dpp)->attrelid = new_rel_oid;
|
||||||
(*dpp)->attnvals = 0;
|
(*dpp)->attdisbursion = 0;
|
||||||
|
|
||||||
tup = heap_addheader(Natts_pg_attribute,
|
tup = heap_addheader(Natts_pg_attribute,
|
||||||
ATTRIBUTE_TUPLE_SIZE,
|
ATTRIBUTE_TUPLE_SIZE,
|
||||||
@ -592,7 +592,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
|
|||||||
dpp = HeapAtt;
|
dpp = HeapAtt;
|
||||||
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++) {
|
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++) {
|
||||||
(*dpp)->attrelid = new_rel_oid;
|
(*dpp)->attrelid = new_rel_oid;
|
||||||
/* (*dpp)->attnvals = 0; unneeded */
|
/* (*dpp)->attdisbursion = 0; unneeded */
|
||||||
|
|
||||||
tup = heap_addheader(Natts_pg_attribute,
|
tup = heap_addheader(Natts_pg_attribute,
|
||||||
ATTRIBUTE_TUPLE_SIZE,
|
ATTRIBUTE_TUPLE_SIZE,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.11 1997/08/21 01:32:19 vadim Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.12 1997/08/21 03:01:27 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||||
@ -382,7 +382,7 @@ PerformAddAttribute(char *relationName,
|
|||||||
(Datum) NULL);
|
(Datum) NULL);
|
||||||
|
|
||||||
attributeD.attrelid = reltup->t_oid;
|
attributeD.attrelid = reltup->t_oid;
|
||||||
attributeD.attnvals = 0; /* XXX temporary */
|
attributeD.attdisbursion = 0; /* XXX temporary */
|
||||||
attributeD.attcacheoff = -1;
|
attributeD.attcacheoff = -1;
|
||||||
|
|
||||||
attributeTuple = heap_addheader(Natts_pg_attribute,
|
attributeTuple = heap_addheader(Natts_pg_attribute,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.40 1997/08/21 02:27:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.41 1997/08/21 03:01:36 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1814,7 +1814,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
|
|||||||
}
|
}
|
||||||
if (selratio > 1.0)
|
if (selratio > 1.0)
|
||||||
selratio = 1.0;
|
selratio = 1.0;
|
||||||
attp->attnvals = selratio;
|
attp->attdisbursion = selratio;
|
||||||
WriteNoReleaseBuffer(abuf);
|
WriteNoReleaseBuffer(abuf);
|
||||||
|
|
||||||
/* DO PG_STATISTIC INSERTS */
|
/* DO PG_STATISTIC INSERTS */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.12 1997/08/20 14:53:20 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.13 1997/08/21 03:01:42 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -507,7 +507,7 @@ ExecSetTypeInfo(int index,
|
|||||||
|
|
||||||
att->atttypid = typeID;
|
att->atttypid = typeID;
|
||||||
att->attdefrel = 0; /* dummy value */
|
att->attdefrel = 0; /* dummy value */
|
||||||
att->attnvals = 0; /* dummy value */
|
att->attdisbursion = 0; /* dummy value */
|
||||||
att->atttyparg = 0; /* dummy value */
|
att->atttyparg = 0; /* dummy value */
|
||||||
att->attlen = attLen;
|
att->attlen = attLen;
|
||||||
att->attnum = attNum;
|
att->attnum = attNum;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.7 1997/08/21 02:28:34 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.8 1997/08/21 03:02:04 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -41,7 +41,7 @@
|
|||||||
*/
|
*/
|
||||||
#define FunctionalSelectivity(nIndKeys,attNum) (attNum==InvalidAttrNumber)
|
#define FunctionalSelectivity(nIndKeys,attNum) (attNum==InvalidAttrNumber)
|
||||||
|
|
||||||
static float32data getattnvals(Oid relid, AttrNumber attnum);
|
static float32data getattdisbursion(Oid relid, AttrNumber attnum);
|
||||||
static void gethilokey(Oid relid, AttrNumber attnum, Oid opid,
|
static void gethilokey(Oid relid, AttrNumber attnum, Oid opid,
|
||||||
char **high, char **low);
|
char **high, char **low);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ eqsel(Oid opid,
|
|||||||
if (NONVALUE(attno) || NONVALUE(relid))
|
if (NONVALUE(attno) || NONVALUE(relid))
|
||||||
*result = 0.1;
|
*result = 0.1;
|
||||||
else
|
else
|
||||||
*result = (float64data)getattnvals(relid, (int) attno);
|
*result = (float64data)getattdisbursion(relid, (int) attno);
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ intltsel(Oid opid,
|
|||||||
if ((flag & SEL_RIGHT && val < low) ||
|
if ((flag & SEL_RIGHT && val < low) ||
|
||||||
(!(flag & SEL_RIGHT) && val > high)) {
|
(!(flag & SEL_RIGHT) && val > high)) {
|
||||||
float32data nvals;
|
float32data nvals;
|
||||||
nvals = getattnvals(relid, (int) attno);
|
nvals = getattdisbursion(relid, (int) attno);
|
||||||
if (nvals == 0)
|
if (nvals == 0)
|
||||||
*result = 1.0 / 3.0;
|
*result = 1.0 / 3.0;
|
||||||
else {
|
else {
|
||||||
@ -182,8 +182,8 @@ eqjoinsel(Oid opid,
|
|||||||
NONVALUE(attno2) || NONVALUE(relid2))
|
NONVALUE(attno2) || NONVALUE(relid2))
|
||||||
*result = 0.1;
|
*result = 0.1;
|
||||||
else {
|
else {
|
||||||
num1 = getattnvals(relid1, (int) attno1);
|
num1 = getattdisbursion(relid1, (int) attno1);
|
||||||
num2 = getattnvals(relid2, (int) attno2);
|
num2 = getattdisbursion(relid2, (int) attno2);
|
||||||
max = (num1 > num2) ? num1 : num2;
|
max = (num1 > num2) ? num1 : num2;
|
||||||
if (max == 0)
|
if (max == 0)
|
||||||
*result = 1.0;
|
*result = 1.0;
|
||||||
@ -245,10 +245,10 @@ intgtjoinsel(Oid opid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* getattnvals - Retrieves the number of values within an attribute.
|
* getattdisbursion - Retrieves the number of values within an attribute.
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
* getattnvals and gethilokey both currently use keyed
|
* getattdisbursion and gethilokey both currently use keyed
|
||||||
* relation scans and amgetattr. Alternatively,
|
* relation scans and amgetattr. Alternatively,
|
||||||
* the relation scan could be non-keyed and the tuple
|
* the relation scan could be non-keyed and the tuple
|
||||||
* returned could be cast (struct X *) tuple + tuple->t_hoff.
|
* returned could be cast (struct X *) tuple + tuple->t_hoff.
|
||||||
@ -259,7 +259,7 @@ intgtjoinsel(Oid opid,
|
|||||||
* for gethilokey which accesses stahikey in struct statistic.
|
* for gethilokey which accesses stahikey in struct statistic.
|
||||||
*/
|
*/
|
||||||
static float32data
|
static float32data
|
||||||
getattnvals(Oid relid, AttrNumber attnum)
|
getattdisbursion(Oid relid, AttrNumber attnum)
|
||||||
{
|
{
|
||||||
HeapTuple atp;
|
HeapTuple atp;
|
||||||
float32data nvals;
|
float32data nvals;
|
||||||
@ -270,11 +270,11 @@ getattnvals(Oid relid, AttrNumber attnum)
|
|||||||
Int16GetDatum(attnum),
|
Int16GetDatum(attnum),
|
||||||
0,0);
|
0,0);
|
||||||
if (!HeapTupleIsValid(atp)) {
|
if (!HeapTupleIsValid(atp)) {
|
||||||
elog(WARN, "getattnvals: no attribute tuple %d %d",
|
elog(WARN, "getattdisbursion: no attribute tuple %d %d",
|
||||||
relid, attnum);
|
relid, attnum);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
nvals = ((AttributeTupleForm ) GETSTRUCT(atp))->attnvals;
|
nvals = ((AttributeTupleForm ) GETSTRUCT(atp))->attdisbursion;
|
||||||
if (nvals > 0) return(nvals);
|
if (nvals > 0) return(nvals);
|
||||||
|
|
||||||
atp = SearchSysCacheTuple(RELOID, ObjectIdGetDatum(relid),
|
atp = SearchSysCacheTuple(RELOID, ObjectIdGetDatum(relid),
|
||||||
@ -283,7 +283,7 @@ getattnvals(Oid relid, AttrNumber attnum)
|
|||||||
just for now, in case number of distinctive values is
|
just for now, in case number of distinctive values is
|
||||||
not cached */
|
not cached */
|
||||||
if (!HeapTupleIsValid(atp)) {
|
if (!HeapTupleIsValid(atp)) {
|
||||||
elog(WARN, "getattnvals: no relation tuple %d", relid);
|
elog(WARN, "getattdisbursion: no relation tuple %d", relid);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pg_attribute.h,v 1.10 1997/08/21 02:28:52 momjian Exp $
|
* $Id: pg_attribute.h,v 1.11 1997/08/21 03:02:13 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* the genbki.sh script reads this file and generates .bki
|
||||||
@ -48,7 +48,7 @@ CATALOG(pg_attribute) BOOTSTRAP {
|
|||||||
attributes of this instance, so they had better match or Postgres
|
attributes of this instance, so they had better match or Postgres
|
||||||
will fail.
|
will fail.
|
||||||
*/
|
*/
|
||||||
float4 attnvals;
|
float4 attdisbursion;
|
||||||
int2 attlen;
|
int2 attlen;
|
||||||
/* attlen is a copy of the typlen field from pg_type for this
|
/* attlen is a copy of the typlen field from pg_type for this
|
||||||
attribute. See atttypid above. See struct TypeTupleFormData for
|
attribute. See atttypid above. See struct TypeTupleFormData for
|
||||||
@ -118,7 +118,7 @@ typedef FormData_pg_attribute *AttributeTupleForm;
|
|||||||
#define Anum_pg_attribute_attname 2
|
#define Anum_pg_attribute_attname 2
|
||||||
#define Anum_pg_attribute_atttypid 3
|
#define Anum_pg_attribute_atttypid 3
|
||||||
|
|
||||||
#define Anum_pg_attribute_attnvals 4
|
#define Anum_pg_attribute_attdisbursion 4
|
||||||
|
|
||||||
#define Anum_pg_attribute_attlen 5
|
#define Anum_pg_attribute_attlen 5
|
||||||
#define Anum_pg_attribute_attnum 6
|
#define Anum_pg_attribute_attnum 6
|
||||||
@ -362,7 +362,7 @@ DATA(insert OID = 0 ( 1261 vtype 18 0 1 -11 0 -1 t f c f f));
|
|||||||
{ 1249l, {"attrelid"}, 26l, 0l, 4, 1, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1249l, {"attrelid"}, 26l, 0l, 4, 1, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1249l, {"attname"}, 19l, 0l, NAMEDATALEN, 2, 0l, -1l, '\0', '\0', 'i', '\0', '\0' }, \
|
{ 1249l, {"attname"}, 19l, 0l, NAMEDATALEN, 2, 0l, -1l, '\0', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1249l, {"atttypid"}, 26l, 0l, 4, 3, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1249l, {"atttypid"}, 26l, 0l, 4, 3, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1249l, {"attnvals"}, 700l, 0l, 4, 4, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1249l, {"attdisbursion"}, 700l, 0l, 4, 4, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
{ 1249l, {"attlen"}, 21l, 0l, 2, 5, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
{ 1249l, {"attlen"}, 21l, 0l, 2, 5, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
||||||
{ 1249l, {"attnum"}, 21l, 0l, 2, 6, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
{ 1249l, {"attnum"}, 21l, 0l, 2, 6, 0l, -1l, '\001', '\0', 's', '\0', '\0' }, \
|
||||||
{ 1249l, {"attnelems"}, 23l, 0l, 4, 7, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
{ 1249l, {"attnelems"}, 23l, 0l, 4, 7, 0l, -1l, '\001', '\0', 'i', '\0', '\0' }, \
|
||||||
@ -376,7 +376,7 @@ DATA(insert OID = 0 ( 1261 vtype 18 0 1 -11 0 -1 t f c f f));
|
|||||||
DATA(insert OID = 0 ( 1249 attrelid 26 0 4 1 0 -1 t f i f f));
|
DATA(insert OID = 0 ( 1249 attrelid 26 0 4 1 0 -1 t f i f f));
|
||||||
DATA(insert OID = 0 ( 1249 attname 19 0 NAMEDATALEN 2 0 -1 f f i f f));
|
DATA(insert OID = 0 ( 1249 attname 19 0 NAMEDATALEN 2 0 -1 f f i f f));
|
||||||
DATA(insert OID = 0 ( 1249 atttypid 26 0 4 3 0 -1 t f i f f));
|
DATA(insert OID = 0 ( 1249 atttypid 26 0 4 3 0 -1 t f i f f));
|
||||||
DATA(insert OID = 0 ( 1249 attnvals 700 0 4 4 0 -1 t f i f f));
|
DATA(insert OID = 0 ( 1249 attdisbursion 700 0 4 4 0 -1 t f i f f));
|
||||||
DATA(insert OID = 0 ( 1249 attlen 21 0 2 5 0 -1 t f s f f));
|
DATA(insert OID = 0 ( 1249 attlen 21 0 2 5 0 -1 t f s f f));
|
||||||
DATA(insert OID = 0 ( 1249 attnum 21 0 2 6 0 -1 t f s f f));
|
DATA(insert OID = 0 ( 1249 attnum 21 0 2 6 0 -1 t f s f f));
|
||||||
DATA(insert OID = 0 ( 1249 attnelems 23 0 4 7 0 -1 t f i f f));
|
DATA(insert OID = 0 ( 1249 attnelems 23 0 4 7 0 -1 t f i f f));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user