1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Remove unused system table columns:

pg_language.lancompiler
pg_operator.oprprec
pg_operator.oprisleft
pg_proc.proimplicit
pg_proc.probyte_pct
pg_proc.properbyte_cpu
pg_proc.propercall_cpu
pg_proc.prooutin_ratio
pg_shadow.usetrace
pg_type.typprtlen
pg_type.typreceive
pg_type.typsend

Attempts to use the obsoleted attributes of pg_operator or pg_proc
in the CREATE commands will be greeted by a warning.  For pg_type,
there is no warning (yet) because pg_dump scripts still contain these
attributes.

Also remove new but already obsolete spellings
isVolatile, isStable, isImmutable in WITH clause.  (Use new syntax
instead.)
This commit is contained in:
Peter Eisentraut
2002-07-24 19:11:14 +00:00
parent a78777558c
commit 739adf32ee
36 changed files with 2267 additions and 2739 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.12 2002/07/22 20:23:19 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.13 2002/07/24 19:11:09 petere Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@ -272,11 +272,7 @@ compute_attributes_sql_style(const List *options,
*------------
*/
static void
compute_attributes_with_style(List *parameters,
int32 *byte_pct_p, int32 *perbyte_cpu_p,
int32 *percall_cpu_p, int32 *outin_ratio_p,
bool *isStrict_p,
char *volatility_p)
compute_attributes_with_style(List *parameters, bool *isStrict_p, char *volatility_p)
{
List *pl;
@ -286,33 +282,11 @@ compute_attributes_with_style(List *parameters,
if (strcasecmp(param->defname, "isstrict") == 0)
*isStrict_p = true;
else if (strcasecmp(param->defname, "isimmutable") == 0)
*volatility_p = PROVOLATILE_IMMUTABLE;
else if (strcasecmp(param->defname, "isstable") == 0)
*volatility_p = PROVOLATILE_STABLE;
else if (strcasecmp(param->defname, "isvolatile") == 0)
*volatility_p = PROVOLATILE_VOLATILE;
else if (strcasecmp(param->defname, "iscachable") == 0)
{
/* obsolete spelling of isImmutable */
*volatility_p = PROVOLATILE_IMMUTABLE;
}
else if (strcasecmp(param->defname, "trusted") == 0)
{
/*
* we don't have untrusted functions any more. The 4.2
* implementation is lousy anyway so I took it out. -ay 10/94
*/
elog(ERROR, "untrusted function has been decommissioned.");
}
else if (strcasecmp(param->defname, "byte_pct") == 0)
*byte_pct_p = (int) defGetNumeric(param);
else if (strcasecmp(param->defname, "perbyte_cpu") == 0)
*perbyte_cpu_p = (int) defGetNumeric(param);
else if (strcasecmp(param->defname, "percall_cpu") == 0)
*percall_cpu_p = (int) defGetNumeric(param);
else if (strcasecmp(param->defname, "outin_ratio") == 0)
*outin_ratio_p = (int) defGetNumeric(param);
else
elog(WARNING, "Unrecognized function attribute '%s' ignored",
param->defname);
@ -383,10 +357,6 @@ CreateFunction(CreateFunctionStmt *stmt)
AclResult aclresult;
int parameterCount;
Oid parameterTypes[FUNC_MAX_ARGS];
int32 byte_pct,
perbyte_cpu,
percall_cpu,
outin_ratio;
bool isStrict,
security;
char volatility;
@ -404,10 +374,6 @@ CreateFunction(CreateFunctionStmt *stmt)
aclcheck_error(aclresult, get_namespace_name(namespaceId));
/* defaults attributes */
byte_pct = BYTE_PCT;
perbyte_cpu = PERBYTE_CPU;
percall_cpu = PERCALL_CPU;
outin_ratio = OUTIN_RATIO;
isStrict = false;
security = false;
volatility = PROVOLATILE_VOLATILE;
@ -459,9 +425,7 @@ CreateFunction(CreateFunctionStmt *stmt)
parameterCount = compute_parameter_types(stmt->argTypes, languageOid,
parameterTypes);
compute_attributes_with_style(stmt->withClause,
&byte_pct, &perbyte_cpu, &percall_cpu,
&outin_ratio, &isStrict, &volatility);
compute_attributes_with_style(stmt->withClause, &isStrict, &volatility);
interpret_AS_clause(languageOid, languageName, as_clause,
&prosrc_str, &probin_str);
@ -505,10 +469,6 @@ CreateFunction(CreateFunctionStmt *stmt)
security,
isStrict,
volatility,
byte_pct,
perbyte_cpu,
percall_cpu,
outin_ratio,
parameterCount,
parameterTypes);
}

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/operatorcmds.c,v 1.5 2002/07/12 18:43:16 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/operatorcmds.c,v 1.6 2002/07/24 19:11:09 petere Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -62,11 +62,8 @@ DefineOperator(List *names, List *parameters)
char *oprName;
Oid oprNamespace;
AclResult aclresult;
uint16 precedence = 0; /* operator precedence */
bool canHash = false; /* operator hashes */
bool canMerge = false; /* operator merges */
bool isLeftAssociative = true; /* operator is left
* associative */
List *functionName = NIL; /* function for operator */
TypeName *typeName1 = NULL; /* first type name */
TypeName *typeName2 = NULL; /* second type name */
@ -113,16 +110,6 @@ DefineOperator(List *names, List *parameters)
}
else if (strcasecmp(defel->defname, "procedure") == 0)
functionName = defGetQualifiedName(defel);
else if (strcasecmp(defel->defname, "precedence") == 0)
{
/* NOT IMPLEMENTED (never worked in v4.2) */
elog(NOTICE, "CREATE OPERATOR: precedence not implemented");
}
else if (strcasecmp(defel->defname, "associativity") == 0)
{
/* NOT IMPLEMENTED (never worked in v4.2) */
elog(NOTICE, "CREATE OPERATOR: associativity not implemented");
}
else if (strcasecmp(defel->defname, "commutator") == 0)
commutatorName = defGetQualifiedName(defel);
else if (strcasecmp(defel->defname, "negator") == 0)
@ -190,8 +177,6 @@ DefineOperator(List *names, List *parameters)
typeId1, /* left type id */
typeId2, /* right type id */
functionName, /* function for operator */
precedence, /* operator precedence */
isLeftAssociative, /* operator is left associative */
commutatorName, /* optional commutator operator
* name */
negatorName, /* optional negator operator name */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.37 2002/07/20 05:16:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.38 2002/07/24 19:11:09 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -110,8 +110,6 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
values[i++] = BoolGetDatum(stmt->pltrusted);
values[i++] = ObjectIdGetDatum(procOid);
values[i++] = ObjectIdGetDatum(valProcOid);
values[i++] = DirectFunctionCall1(textin,
CStringGetDatum(stmt->plcompiler));
nulls[i] = 'n'; /* lanacl */
rel = heap_openr(LanguageRelationName, RowExclusiveLock);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.7 2002/07/20 05:16:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.8 2002/07/24 19:11:09 petere Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -20,7 +20,7 @@
* NOTES
* These things must be defined and committed in the following order:
* "create function":
* input/output, recv/send procedures
* input/output functions
* "create type":
* type
* "create operator":
@ -62,12 +62,9 @@ DefineType(List *names, List *parameters)
Oid typeNamespace;
AclResult aclresult;
int16 internalLength = -1; /* int2 */
int16 externalLength = -1; /* int2 */
Oid elemType = InvalidOid;
List *inputName = NIL;
List *outputName = NIL;
List *sendName = NIL;
List *receiveName = NIL;
char *defaultValue = NULL;
bool byValue = false;
char delimiter = DEFAULT_TYPDELIM;
@ -75,8 +72,6 @@ DefineType(List *names, List *parameters)
char storage = 'p'; /* default TOAST storage method */
Oid inputOid;
Oid outputOid;
Oid sendOid;
Oid receiveOid;
char *shadow_type;
List *pl;
Oid typoid;
@ -105,15 +100,15 @@ DefineType(List *names, List *parameters)
if (strcasecmp(defel->defname, "internallength") == 0)
internalLength = defGetTypeLength(defel);
else if (strcasecmp(defel->defname, "externallength") == 0)
externalLength = defGetTypeLength(defel);
; /* ignored -- remove after 7.3 */
else if (strcasecmp(defel->defname, "input") == 0)
inputName = defGetQualifiedName(defel);
else if (strcasecmp(defel->defname, "output") == 0)
outputName = defGetQualifiedName(defel);
else if (strcasecmp(defel->defname, "send") == 0)
sendName = defGetQualifiedName(defel);
; /* ignored -- remove after 7.3 */
else if (strcasecmp(defel->defname, "receive") == 0)
receiveName = defGetQualifiedName(defel);
; /* ignored -- remove after 7.3 */
else if (strcasecmp(defel->defname, "delimiter") == 0)
{
char *p = defGetString(defel);
@ -187,14 +182,6 @@ DefineType(List *names, List *parameters)
/* Convert I/O proc names to OIDs */
inputOid = findTypeIOFunction(inputName, false);
outputOid = findTypeIOFunction(outputName, true);
if (sendName)
sendOid = findTypeIOFunction(sendName, true);
else
sendOid = outputOid;
if (receiveName)
receiveOid = findTypeIOFunction(receiveName, false);
else
receiveOid = inputOid;
/*
* now have TypeCreate do all the real work.
@ -205,13 +192,10 @@ DefineType(List *names, List *parameters)
InvalidOid, /* preassigned type oid (not done here) */
InvalidOid, /* relation oid (n/a here) */
internalLength, /* internal size */
externalLength, /* external size */
'b', /* type-type (base type) */
delimiter, /* array element delimiter */
inputOid, /* input procedure */
outputOid, /* output procedure */
receiveOid, /* receive procedure */
sendOid, /* send procedure */
elemType, /* element type ID */
InvalidOid, /* base type ID (only for domains) */
defaultValue, /* default type value */
@ -237,13 +221,10 @@ DefineType(List *names, List *parameters)
InvalidOid, /* preassigned type oid (not done here) */
InvalidOid, /* relation oid (n/a here) */
-1, /* internal size */
-1, /* external size */
'b', /* type-type (base type) */
DEFAULT_TYPDELIM, /* array element delimiter */
F_ARRAY_IN, /* input procedure */
F_ARRAY_OUT, /* output procedure */
F_ARRAY_IN, /* receive procedure */
F_ARRAY_OUT, /* send procedure */
typoid, /* element type ID */
InvalidOid, /* base type ID */
NULL, /* never a default type value */
@ -346,11 +327,8 @@ DefineDomain(CreateDomainStmt *stmt)
Oid domainNamespace;
AclResult aclresult;
int16 internalLength;
int16 externalLength;
Oid inputProcedure;
Oid outputProcedure;
Oid receiveProcedure;
Oid sendProcedure;
bool byValue;
char delimiter;
char alignment;
@ -421,17 +399,12 @@ DefineDomain(CreateDomainStmt *stmt)
/* Storage Length */
internalLength = baseType->typlen;
/* External Length (unused) */
externalLength = baseType->typprtlen;
/* Array element Delimiter */
delimiter = baseType->typdelim;
/* I/O Functions */
inputProcedure = baseType->typinput;
outputProcedure = baseType->typoutput;
receiveProcedure = baseType->typreceive;
sendProcedure = baseType->typsend;
/* Inherited default value */
datum = SysCacheGetAttr(TYPEOID, typeTup,
@ -549,13 +522,10 @@ DefineDomain(CreateDomainStmt *stmt)
InvalidOid, /* preassigned type oid (none here) */
InvalidOid, /* relation oid (n/a here) */
internalLength, /* internal size */
externalLength, /* external size */
'd', /* type-type (domain type) */
delimiter, /* array element delimiter */
inputProcedure, /* input procedure */
outputProcedure, /* output procedure */
receiveProcedure, /* receive procedure */
sendProcedure, /* send procedure */
basetypelem, /* element type ID */
basetypeoid, /* base type ID */
defaultValue, /* default type value (text) */

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.105 2002/06/20 20:29:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.106 2002/07/24 19:11:09 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -560,7 +560,6 @@ CreateUser(CreateUserStmt *stmt)
new_record[Anum_pg_shadow_usesysid - 1] = Int32GetDatum(sysid);
AssertState(BoolIsValid(createdb));
new_record[Anum_pg_shadow_usecreatedb - 1] = BoolGetDatum(createdb);
new_record[Anum_pg_shadow_usetrace - 1] = BoolGetDatum(false);
AssertState(BoolIsValid(createuser));
new_record[Anum_pg_shadow_usesuper - 1] = BoolGetDatum(createuser);
/* superuser gets catupd right by default */