Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8265769c
Commit
8265769c
authored
Aug 10, 2001
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
message refinements
parent
e24b4b28
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
67 deletions
+65
-67
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+15
-17
src/backend/catalog/index.c
src/backend/catalog/index.c
+6
-6
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_aggregate.c
+8
-8
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_operator.c
+17
-17
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_proc.c
+13
-13
src/backend/catalog/pg_type.c
src/backend/catalog/pg_type.c
+6
-6
No files found.
src/backend/catalog/heap.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.17
2 2001/08/09 18:28:16
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.17
3 2001/08/10 15:49:39
petere Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -202,8 +202,8 @@ heap_create(char *relname,
...
@@ -202,8 +202,8 @@ heap_create(char *relname,
*/
*/
if
(
relname
&&
!
allow_system_table_mods
&&
if
(
relname
&&
!
allow_system_table_mods
&&
IsSystemRelationName
(
relname
)
&&
IsNormalProcessingMode
())
IsSystemRelationName
(
relname
)
&&
IsNormalProcessingMode
())
elog
(
ERROR
,
"
Illegal class name '%s'
"
elog
(
ERROR
,
"
invalid relation name
\"
%s
\"
;
"
"
\n\t
T
he 'pg_' name prefix is reserved for system catalogs"
,
"
t
he 'pg_' name prefix is reserved for system catalogs"
,
relname
);
relname
);
/*
/*
...
@@ -356,8 +356,7 @@ CheckAttributeNames(TupleDesc tupdesc)
...
@@ -356,8 +356,7 @@ CheckAttributeNames(TupleDesc tupdesc)
if
(
strcmp
(
NameStr
(
SysAtt
[
j
]
->
attname
),
if
(
strcmp
(
NameStr
(
SysAtt
[
j
]
->
attname
),
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
{
{
elog
(
ERROR
,
"Attribute '%s' has a name conflict"
elog
(
ERROR
,
"name of column
\"
%s
\"
conflicts with an existing system column"
,
"
\n\t
Name matches an existing system attribute"
,
NameStr
(
SysAtt
[
j
]
->
attname
));
NameStr
(
SysAtt
[
j
]
->
attname
));
}
}
}
}
...
@@ -379,7 +378,7 @@ CheckAttributeNames(TupleDesc tupdesc)
...
@@ -379,7 +378,7 @@ CheckAttributeNames(TupleDesc tupdesc)
if
(
strcmp
(
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
),
if
(
strcmp
(
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
),
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
{
{
elog
(
ERROR
,
"
Attribute '%s' is repe
ated"
,
elog
(
ERROR
,
"
column name
\"
%s
\"
is duplic
ated"
,
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
));
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
));
}
}
}
}
...
@@ -713,8 +712,7 @@ heap_create_with_catalog(char *relname,
...
@@ -713,8 +712,7 @@ heap_create_with_catalog(char *relname,
*/
*/
Assert
(
IsNormalProcessingMode
()
||
IsBootstrapProcessingMode
());
Assert
(
IsNormalProcessingMode
()
||
IsBootstrapProcessingMode
());
if
(
natts
<=
0
||
natts
>
MaxHeapAttributeNumber
)
if
(
natts
<=
0
||
natts
>
MaxHeapAttributeNumber
)
elog
(
ERROR
,
"Number of attributes is out of range"
elog
(
ERROR
,
"Number of columns is out of range (1 to %d)"
,
"
\n\t
From 1 to %d attributes may be specified"
,
MaxHeapAttributeNumber
);
MaxHeapAttributeNumber
);
CheckAttributeNames
(
tupdesc
);
CheckAttributeNames
(
tupdesc
);
...
@@ -1072,7 +1070,7 @@ heap_truncate(char *relname)
...
@@ -1072,7 +1070,7 @@ heap_truncate(char *relname)
* anyway).
* anyway).
*/
*/
if
(
IsTransactionBlock
()
&&
!
rel
->
rd_myxactonly
)
if
(
IsTransactionBlock
()
&&
!
rel
->
rd_myxactonly
)
elog
(
ERROR
,
"TRUNCATE TABLE cannot run inside a
BEGIN/END
block"
);
elog
(
ERROR
,
"TRUNCATE TABLE cannot run inside a
transaction
block"
);
/*
/*
* Release any buffers associated with this relation. If they're
* Release any buffers associated with this relation. If they're
...
@@ -1225,7 +1223,7 @@ DeleteTypeTuple(Relation rel)
...
@@ -1225,7 +1223,7 @@ DeleteTypeTuple(Relation rel)
heap_endscan
(
pg_type_scan
);
heap_endscan
(
pg_type_scan
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
elog
(
ERROR
,
"DeleteTypeTuple:
att
of type %s exists in relation %u"
,
elog
(
ERROR
,
"DeleteTypeTuple:
column
of type %s exists in relation %u"
,
RelationGetRelationName
(
rel
),
relid
);
RelationGetRelationName
(
rel
),
relid
);
}
}
heap_endscan
(
pg_attribute_scan
);
heap_endscan
(
pg_attribute_scan
);
...
@@ -1638,15 +1636,15 @@ AddRelationRawConstraints(Relation rel,
...
@@ -1638,15 +1636,15 @@ AddRelationRawConstraints(Relation rel,
* Make sure default expr does not refer to any vars.
* Make sure default expr does not refer to any vars.
*/
*/
if
(
contain_var_clause
(
expr
))
if
(
contain_var_clause
(
expr
))
elog
(
ERROR
,
"
Cannot use attribute(s)
in DEFAULT clause"
);
elog
(
ERROR
,
"
cannot use column references
in DEFAULT clause"
);
/*
/*
* No subplans or aggregates, either...
* No subplans or aggregates, either...
*/
*/
if
(
contain_subplans
(
expr
))
if
(
contain_subplans
(
expr
))
elog
(
ERROR
,
"
Cannot use subselect
in DEFAULT clause"
);
elog
(
ERROR
,
"
cannot use subselects
in DEFAULT clause"
);
if
(
contain_agg_clause
(
expr
))
if
(
contain_agg_clause
(
expr
))
elog
(
ERROR
,
"
Cannot use aggregate
in DEFAULT clause"
);
elog
(
ERROR
,
"
cannot use aggregate functions
in DEFAULT clause"
);
/*
/*
* Check that it will be possible to coerce the expression to the
* Check that it will be possible to coerce the expression to the
...
@@ -1790,23 +1788,23 @@ AddRelationRawConstraints(Relation rel,
...
@@ -1790,23 +1788,23 @@ AddRelationRawConstraints(Relation rel,
* Make sure it yields a boolean result.
* Make sure it yields a boolean result.
*/
*/
if
(
exprType
(
expr
)
!=
BOOLOID
)
if
(
exprType
(
expr
)
!=
BOOLOID
)
elog
(
ERROR
,
"CHECK '%s' does not yield boolean result"
,
elog
(
ERROR
,
"CHECK
constraint expression
'%s' does not yield boolean result"
,
ccname
);
ccname
);
/*
/*
* Make sure no outside relations are referred to.
* Make sure no outside relations are referred to.
*/
*/
if
(
length
(
pstate
->
p_rtable
)
!=
1
)
if
(
length
(
pstate
->
p_rtable
)
!=
1
)
elog
(
ERROR
,
"Only relation
\"
%s
\"
can be referenced in CHECK"
,
elog
(
ERROR
,
"Only relation
\"
%s
\"
can be referenced in CHECK
constraint expression
"
,
relname
);
relname
);
/*
/*
* No subplans or aggregates, either...
* No subplans or aggregates, either...
*/
*/
if
(
contain_subplans
(
expr
))
if
(
contain_subplans
(
expr
))
elog
(
ERROR
,
"
Cannot use subselect in CHECK clause
"
);
elog
(
ERROR
,
"
cannot use subselect in CHECK constraint expression
"
);
if
(
contain_agg_clause
(
expr
))
if
(
contain_agg_clause
(
expr
))
elog
(
ERROR
,
"
Cannot use aggregate in CHECK clause
"
);
elog
(
ERROR
,
"
cannot use aggregate function in CHECK constraint expression
"
);
/*
/*
* Might as well try to reduce any constant expressions.
* Might as well try to reduce any constant expressions.
...
...
src/backend/catalog/index.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.15
7 2001/07/16 05:06:57 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.15
8 2001/08/10 15:49:39 petere
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -111,13 +111,13 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName, bool istemp)
...
@@ -111,13 +111,13 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName, bool istemp)
if
((
!
istemp
&&
OidIsValid
(
indoid
))
||
if
((
!
istemp
&&
OidIsValid
(
indoid
))
||
(
istemp
&&
is_temp_rel_name
(
indexRelationName
)))
(
istemp
&&
is_temp_rel_name
(
indexRelationName
)))
elog
(
ERROR
,
"
Cannot create index: '%s'
already exists"
,
elog
(
ERROR
,
"
index named
\"
%s
\"
already exists"
,
indexRelationName
);
indexRelationName
);
heapoid
=
RelnameFindRelid
(
heapRelationName
);
heapoid
=
RelnameFindRelid
(
heapRelationName
);
if
(
!
OidIsValid
(
heapoid
))
if
(
!
OidIsValid
(
heapoid
))
elog
(
ERROR
,
"
Cannot create index on '%s': relation does not exist
"
,
elog
(
ERROR
,
"
cannot create index on non-existent relation
\"
%s
\"
"
,
heapRelationName
);
heapRelationName
);
return
heapoid
;
return
heapoid
;
...
@@ -237,7 +237,7 @@ ConstructTupleDescriptor(Relation heapRelation,
...
@@ -237,7 +237,7 @@ ConstructTupleDescriptor(Relation heapRelation,
* here we are indexing on a normal attribute (1...n)
* here we are indexing on a normal attribute (1...n)
*/
*/
if
(
atnum
>
natts
)
if
(
atnum
>
natts
)
elog
(
ERROR
,
"
Cannot create index: attribute
%d does not exist"
,
elog
(
ERROR
,
"
cannot create index: column
%d does not exist"
,
atnum
);
atnum
);
from
=
heapTupDesc
->
attrs
[
AttrNumberGetAttrOffset
(
atnum
)];
from
=
heapTupDesc
->
attrs
[
AttrNumberGetAttrOffset
(
atnum
)];
...
@@ -686,7 +686,7 @@ index_create(char *heapRelationName,
...
@@ -686,7 +686,7 @@ index_create(char *heapRelationName,
*/
*/
if
(
indexInfo
->
ii_NumIndexAttrs
<
1
||
if
(
indexInfo
->
ii_NumIndexAttrs
<
1
||
indexInfo
->
ii_NumKeyAttrs
<
1
)
indexInfo
->
ii_NumKeyAttrs
<
1
)
elog
(
ERROR
,
"must index at least one
attribute
"
);
elog
(
ERROR
,
"must index at least one
column
"
);
if
(
heapRelationName
&&
!
allow_system_table_mods
&&
if
(
heapRelationName
&&
!
allow_system_table_mods
&&
IsSystemRelationName
(
heapRelationName
)
&&
IsNormalProcessingMode
())
IsSystemRelationName
(
heapRelationName
)
&&
IsNormalProcessingMode
())
...
@@ -1856,7 +1856,7 @@ reindex_index(Oid indexId, bool force, bool inplace)
...
@@ -1856,7 +1856,7 @@ reindex_index(Oid indexId, bool force, bool inplace)
* of the index's physical file. Disallow it.
* of the index's physical file. Disallow it.
*/
*/
if
(
IsTransactionBlock
())
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"REINDEX cannot run inside a
BEGIN/END
block"
);
elog
(
ERROR
,
"REINDEX cannot run inside a
transaction
block"
);
old
=
SetReindexProcessing
(
true
);
old
=
SetReindexProcessing
(
true
);
...
...
src/backend/catalog/pg_aggregate.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.3
8 2001/03/22 03:59:20 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.3
9 2001/08/10 15:49:39 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -72,10 +72,10 @@ AggregateCreate(char *aggName,
...
@@ -72,10 +72,10 @@ AggregateCreate(char *aggName,
/* sanity checks */
/* sanity checks */
if
(
!
aggName
)
if
(
!
aggName
)
elog
(
ERROR
,
"
AggregateCreate:
no aggregate name supplied"
);
elog
(
ERROR
,
"no aggregate name supplied"
);
if
(
!
aggtransfnName
)
if
(
!
aggtransfnName
)
elog
(
ERROR
,
"
AggregateCreate:
aggregate must have a transition function"
);
elog
(
ERROR
,
"aggregate must have a transition function"
);
/*
/*
* Handle the aggregate's base type (input data type). This can be
* Handle the aggregate's base type (input data type). This can be
...
@@ -88,7 +88,7 @@ AggregateCreate(char *aggName,
...
@@ -88,7 +88,7 @@ AggregateCreate(char *aggName,
if
(
!
OidIsValid
(
basetype
))
if
(
!
OidIsValid
(
basetype
))
{
{
if
(
strcasecmp
(
aggbasetypeName
,
"ANY"
)
!=
0
)
if
(
strcasecmp
(
aggbasetypeName
,
"ANY"
)
!=
0
)
elog
(
ERROR
,
"
AggregateCreate: Type '%s' undefined
"
,
elog
(
ERROR
,
"
data type %s does not exist
"
,
aggbasetypeName
);
aggbasetypeName
);
basetype
=
InvalidOid
;
basetype
=
InvalidOid
;
}
}
...
@@ -99,7 +99,7 @@ AggregateCreate(char *aggName,
...
@@ -99,7 +99,7 @@ AggregateCreate(char *aggName,
ObjectIdGetDatum
(
basetype
),
ObjectIdGetDatum
(
basetype
),
0
,
0
))
0
,
0
))
elog
(
ERROR
,
elog
(
ERROR
,
"
AggregateCreate: aggregate '%s' with base type '%s'
already exists"
,
"
aggregate function
\"
%s
\"
with base type %s
already exists"
,
aggName
,
aggbasetypeName
);
aggName
,
aggbasetypeName
);
/* handle transtype */
/* handle transtype */
...
@@ -107,7 +107,7 @@ AggregateCreate(char *aggName,
...
@@ -107,7 +107,7 @@ AggregateCreate(char *aggName,
PointerGetDatum
(
aggtranstypeName
),
PointerGetDatum
(
aggtranstypeName
),
0
,
0
,
0
);
0
,
0
,
0
);
if
(
!
OidIsValid
(
transtype
))
if
(
!
OidIsValid
(
transtype
))
elog
(
ERROR
,
"
AggregateCreate: Type '%s' undefined
"
,
elog
(
ERROR
,
"
data type %s does not exit
"
,
aggtranstypeName
);
aggtranstypeName
);
/* handle transfn */
/* handle transfn */
...
@@ -130,7 +130,7 @@ AggregateCreate(char *aggName,
...
@@ -130,7 +130,7 @@ AggregateCreate(char *aggName,
Assert
(
OidIsValid
(
transfn
));
Assert
(
OidIsValid
(
transfn
));
proc
=
(
Form_pg_proc
)
GETSTRUCT
(
tup
);
proc
=
(
Form_pg_proc
)
GETSTRUCT
(
tup
);
if
(
proc
->
prorettype
!=
transtype
)
if
(
proc
->
prorettype
!=
transtype
)
elog
(
ERROR
,
"
AggregateCreate: return type of '%s' is not '%s'
"
,
elog
(
ERROR
,
"
return type of transition function %s is not %s
"
,
aggtransfnName
,
aggtranstypeName
);
aggtransfnName
,
aggtranstypeName
);
/*
/*
...
@@ -143,7 +143,7 @@ AggregateCreate(char *aggName,
...
@@ -143,7 +143,7 @@ AggregateCreate(char *aggName,
{
{
if
(
basetype
!=
transtype
&&
if
(
basetype
!=
transtype
&&
!
IS_BINARY_COMPATIBLE
(
basetype
,
transtype
))
!
IS_BINARY_COMPATIBLE
(
basetype
,
transtype
))
elog
(
ERROR
,
"
AggregateCreate:
must not omit initval when transfn is strict and transtype is not compatible with input type"
);
elog
(
ERROR
,
"must not omit initval when transfn is strict and transtype is not compatible with input type"
);
}
}
ReleaseSysCache
(
tup
);
ReleaseSysCache
(
tup
);
...
...
src/backend/catalog/pg_operator.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.6
0 2001/07/15 22:48:17 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.6
1 2001/08/10 15:49:39 petere
Exp $
*
*
* NOTES
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
* these routines moved here from commands/define.c and somewhat cleaned up.
...
@@ -174,8 +174,8 @@ OperatorGet(char *operatorName,
...
@@ -174,8 +174,8 @@ OperatorGet(char *operatorName,
leftObjectId
=
TypeGet
(
leftTypeName
,
&
leftDefined
);
leftObjectId
=
TypeGet
(
leftTypeName
,
&
leftDefined
);
if
(
!
OidIsValid
(
leftObjectId
)
||
!
leftDefined
)
if
(
!
OidIsValid
(
leftObjectId
)
||
!
leftDefined
)
elog
(
ERROR
,
"
OperatorGet: left type
\"
%s
\"
does not exist"
,
elog
(
ERROR
,
"
left type
\"
%s
\"
of operator %s
does not exist"
,
leftTypeName
);
leftTypeName
,
operatorName
);
}
}
if
(
rightTypeName
)
if
(
rightTypeName
)
...
@@ -183,13 +183,13 @@ OperatorGet(char *operatorName,
...
@@ -183,13 +183,13 @@ OperatorGet(char *operatorName,
rightObjectId
=
TypeGet
(
rightTypeName
,
&
rightDefined
);
rightObjectId
=
TypeGet
(
rightTypeName
,
&
rightDefined
);
if
(
!
OidIsValid
(
rightObjectId
)
||
!
rightDefined
)
if
(
!
OidIsValid
(
rightObjectId
)
||
!
rightDefined
)
elog
(
ERROR
,
"
OperatorGet: right type
\"
%s
\"
does not exist"
,
elog
(
ERROR
,
"
right type
\"
%s
\"
of operator %s
does not exist"
,
rightTypeName
);
rightTypeName
,
operatorName
);
}
}
if
(
!
((
OidIsValid
(
leftObjectId
)
&&
leftDefined
)
||
if
(
!
((
OidIsValid
(
leftObjectId
)
&&
leftDefined
)
||
(
OidIsValid
(
rightObjectId
)
&&
rightDefined
)))
(
OidIsValid
(
rightObjectId
)
&&
rightDefined
)))
elog
(
ERROR
,
"
OperatorGet: must have at least one argument type"
);
elog
(
ERROR
,
"
operator %s must have at least one operand type"
,
operatorName
);
/*
/*
* open the pg_operator relation
* open the pg_operator relation
...
@@ -330,7 +330,7 @@ OperatorShellMake(char *operatorName,
...
@@ -330,7 +330,7 @@ OperatorShellMake(char *operatorName,
if
(
!
((
OidIsValid
(
leftObjectId
)
&&
leftDefined
)
||
if
(
!
((
OidIsValid
(
leftObjectId
)
&&
leftDefined
)
||
(
OidIsValid
(
rightObjectId
)
&&
rightDefined
)))
(
OidIsValid
(
rightObjectId
)
&&
rightDefined
)))
elog
(
ERROR
,
"OperatorShellMake:
no valid argument types??
"
);
elog
(
ERROR
,
"OperatorShellMake:
the operand types are not valid
"
);
/*
/*
* open pg_operator
* open pg_operator
...
@@ -494,7 +494,7 @@ OperatorDef(char *operatorName,
...
@@ -494,7 +494,7 @@ OperatorDef(char *operatorName,
leftTypeId
=
TypeGet
(
leftTypeName
,
&
leftDefined
);
leftTypeId
=
TypeGet
(
leftTypeName
,
&
leftDefined
);
if
(
!
OidIsValid
(
leftTypeId
)
||
!
leftDefined
)
if
(
!
OidIsValid
(
leftTypeId
)
||
!
leftDefined
)
elog
(
ERROR
,
"
OperatorDef:
left type
\"
%s
\"
does not exist"
,
elog
(
ERROR
,
"left type
\"
%s
\"
does not exist"
,
leftTypeName
);
leftTypeName
);
}
}
...
@@ -503,13 +503,13 @@ OperatorDef(char *operatorName,
...
@@ -503,13 +503,13 @@ OperatorDef(char *operatorName,
rightTypeId
=
TypeGet
(
rightTypeName
,
&
rightDefined
);
rightTypeId
=
TypeGet
(
rightTypeName
,
&
rightDefined
);
if
(
!
OidIsValid
(
rightTypeId
)
||
!
rightDefined
)
if
(
!
OidIsValid
(
rightTypeId
)
||
!
rightDefined
)
elog
(
ERROR
,
"
OperatorDef:
right type
\"
%s
\"
does not exist"
,
elog
(
ERROR
,
"right type
\"
%s
\"
does not exist"
,
rightTypeName
);
rightTypeName
);
}
}
if
(
!
((
OidIsValid
(
leftTypeId
)
&&
leftDefined
)
||
if
(
!
((
OidIsValid
(
leftTypeId
)
&&
leftDefined
)
||
(
OidIsValid
(
rightTypeId
)
&&
rightDefined
)))
(
OidIsValid
(
rightTypeId
)
&&
rightDefined
)))
elog
(
ERROR
,
"
OperatorDef: must have at least one argument
type"
);
elog
(
ERROR
,
"
operator must have at least one operand
type"
);
for
(
i
=
0
;
i
<
Natts_pg_operator
;
++
i
)
for
(
i
=
0
;
i
<
Natts_pg_operator
;
++
i
)
{
{
...
@@ -717,7 +717,7 @@ OperatorDef(char *operatorName,
...
@@ -717,7 +717,7 @@ OperatorDef(char *operatorName,
*/
*/
if
(
j
!=
0
)
if
(
j
!=
0
)
elog
(
ERROR
,
elog
(
ERROR
,
"
OperatorDef: operator can't be its own negator or sort op
"
);
"
operator cannot be its own negator or sort operator
"
);
selfCommutator
=
true
;
selfCommutator
=
true
;
values
[
i
++
]
=
ObjectIdGetDatum
(
InvalidOid
);
values
[
i
++
]
=
ObjectIdGetDatum
(
InvalidOid
);
}
}
...
@@ -772,7 +772,7 @@ OperatorDef(char *operatorName,
...
@@ -772,7 +772,7 @@ OperatorDef(char *operatorName,
simple_heap_update
(
pg_operator_desc
,
&
tup
->
t_self
,
tup
);
simple_heap_update
(
pg_operator_desc
,
&
tup
->
t_self
,
tup
);
}
}
else
else
elog
(
ERROR
,
"OperatorDef:
no operator %u
"
,
operatorObjectId
);
elog
(
ERROR
,
"OperatorDef:
operator %u not found
"
,
operatorObjectId
);
heap_endscan
(
pg_operator_scan
);
heap_endscan
(
pg_operator_scan
);
}
}
...
@@ -1023,19 +1023,19 @@ OperatorCreate(char *operatorName,
...
@@ -1023,19 +1023,19 @@ OperatorCreate(char *operatorName,
char
*
rightSortName
)
char
*
rightSortName
)
{
{
if
(
!
leftTypeName
&&
!
rightTypeName
)
if
(
!
leftTypeName
&&
!
rightTypeName
)
elog
(
ERROR
,
"
OperatorCreate: at least one of leftarg or rightarg must be defin
ed"
);
elog
(
ERROR
,
"
at least one of leftarg or rightarg must be specifi
ed"
);
if
(
!
(
leftTypeName
&&
rightTypeName
))
if
(
!
(
leftTypeName
&&
rightTypeName
))
{
{
/* If it's not a binary op, these things mustn't be set: */
/* If it's not a binary op, these things mustn't be set: */
if
(
commutatorName
)
if
(
commutatorName
)
elog
(
ERROR
,
"
OperatorCreate:
only binary operators can have commutators"
);
elog
(
ERROR
,
"only binary operators can have commutators"
);
if
(
joinName
)
if
(
joinName
)
elog
(
ERROR
,
"
OperatorCreate:
only binary operators can have join selectivity"
);
elog
(
ERROR
,
"only binary operators can have join selectivity"
);
if
(
canHash
)
if
(
canHash
)
elog
(
ERROR
,
"
OperatorCreate:
only binary operators can hash"
);
elog
(
ERROR
,
"only binary operators can hash"
);
if
(
leftSortName
||
rightSortName
)
if
(
leftSortName
||
rightSortName
)
elog
(
ERROR
,
"
OperatorCreate:
only binary operators can have sort links"
);
elog
(
ERROR
,
"only binary operators can have sort links"
);
}
}
/*
/*
...
...
src/backend/catalog/pg_proc.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.5
6 2001/08/09 18:28:17
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.5
7 2001/08/10 15:49:39
petere Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -83,7 +83,7 @@ ProcedureCreate(char *procedureName,
...
@@ -83,7 +83,7 @@ ProcedureCreate(char *procedureName,
PointerGetDatum
(
languageName
),
PointerGetDatum
(
languageName
),
0
,
0
,
0
);
0
,
0
,
0
);
if
(
!
OidIsValid
(
languageObjectId
))
if
(
!
OidIsValid
(
languageObjectId
))
elog
(
ERROR
,
"
ProcedureCreate: no such language '%s'
"
,
languageName
);
elog
(
ERROR
,
"
language '%s' does not exist
"
,
languageName
);
parameterCount
=
0
;
parameterCount
=
0
;
MemSet
(
typev
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
MemSet
(
typev
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
...
@@ -93,13 +93,13 @@ ProcedureCreate(char *procedureName,
...
@@ -93,13 +93,13 @@ ProcedureCreate(char *procedureName,
char
*
typnam
=
TypeNameToInternalName
(
t
);
char
*
typnam
=
TypeNameToInternalName
(
t
);
if
(
parameterCount
>=
FUNC_MAX_ARGS
)
if
(
parameterCount
>=
FUNC_MAX_ARGS
)
elog
(
ERROR
,
"
Procedures cannot tak
e more than %d arguments"
,
elog
(
ERROR
,
"
functions cannot hav
e more than %d arguments"
,
FUNC_MAX_ARGS
);
FUNC_MAX_ARGS
);
if
(
strcmp
(
typnam
,
"opaque"
)
==
0
)
if
(
strcmp
(
typnam
,
"opaque"
)
==
0
)
{
{
if
(
languageObjectId
==
SQLlanguageId
)
if
(
languageObjectId
==
SQLlanguageId
)
elog
(
ERROR
,
"
ProcedureCreate: sql functions cannot take
type
\"
opaque
\"
"
);
elog
(
ERROR
,
"
SQL functions cannot have arguments of
type
\"
opaque
\"
"
);
toid
=
InvalidOid
;
toid
=
InvalidOid
;
}
}
else
else
...
@@ -107,15 +107,15 @@ ProcedureCreate(char *procedureName,
...
@@ -107,15 +107,15 @@ ProcedureCreate(char *procedureName,
toid
=
TypeGet
(
typnam
,
&
defined
);
toid
=
TypeGet
(
typnam
,
&
defined
);
if
(
!
OidIsValid
(
toid
))
if
(
!
OidIsValid
(
toid
))
elog
(
ERROR
,
"
ProcedureCreate: arg type '%s' is not defined
"
,
elog
(
ERROR
,
"
argument type %s does not exist
"
,
typnam
);
typnam
);
if
(
!
defined
)
if
(
!
defined
)
elog
(
NOTICE
,
"
ProcedureCreate: arg type '%s'
is only a shell"
,
elog
(
NOTICE
,
"
argument type %s
is only a shell"
,
typnam
);
typnam
);
}
}
if
(
t
->
setof
)
if
(
t
->
setof
)
elog
(
ERROR
,
"
ProcedureCreate:
functions cannot accept set arguments"
);
elog
(
ERROR
,
"functions cannot accept set arguments"
);
typev
[
parameterCount
++
]
=
toid
;
typev
[
parameterCount
++
]
=
toid
;
}
}
...
@@ -126,7 +126,7 @@ ProcedureCreate(char *procedureName,
...
@@ -126,7 +126,7 @@ ProcedureCreate(char *procedureName,
UInt16GetDatum
(
parameterCount
),
UInt16GetDatum
(
parameterCount
),
PointerGetDatum
(
typev
),
PointerGetDatum
(
typev
),
0
))
0
))
elog
(
ERROR
,
"
ProcedureCreate: procedure %s already exists with same argument
s"
,
elog
(
ERROR
,
"
function %s already exists with same argument type
s"
,
procedureName
);
procedureName
);
if
(
languageObjectId
==
SQLlanguageId
)
if
(
languageObjectId
==
SQLlanguageId
)
...
@@ -171,7 +171,7 @@ ProcedureCreate(char *procedureName,
...
@@ -171,7 +171,7 @@ ProcedureCreate(char *procedureName,
if
(
strcmp
(
returnTypeName
,
"opaque"
)
==
0
)
if
(
strcmp
(
returnTypeName
,
"opaque"
)
==
0
)
{
{
if
(
languageObjectId
==
SQLlanguageId
)
if
(
languageObjectId
==
SQLlanguageId
)
elog
(
ERROR
,
"
ProcedureCreate: sql
functions cannot return type
\"
opaque
\"
"
);
elog
(
ERROR
,
"
SQL
functions cannot return type
\"
opaque
\"
"
);
typeObjectId
=
InvalidOid
;
typeObjectId
=
InvalidOid
;
}
}
else
else
...
@@ -180,15 +180,15 @@ ProcedureCreate(char *procedureName,
...
@@ -180,15 +180,15 @@ ProcedureCreate(char *procedureName,
if
(
!
OidIsValid
(
typeObjectId
))
if
(
!
OidIsValid
(
typeObjectId
))
{
{
elog
(
NOTICE
,
"ProcedureCreate: type
'%s'
is not yet defined"
,
elog
(
NOTICE
,
"ProcedureCreate: type
%s
is not yet defined"
,
returnTypeName
);
returnTypeName
);
typeObjectId
=
TypeShellMake
(
returnTypeName
);
typeObjectId
=
TypeShellMake
(
returnTypeName
);
if
(
!
OidIsValid
(
typeObjectId
))
if
(
!
OidIsValid
(
typeObjectId
))
elog
(
ERROR
,
"
ProcedureCreate: could not create type '%s'
"
,
elog
(
ERROR
,
"
could not create type %s
"
,
returnTypeName
);
returnTypeName
);
}
}
else
if
(
!
defined
)
else
if
(
!
defined
)
elog
(
NOTICE
,
"
ProcedureCreate: return type '%s'
is only a shell"
,
elog
(
NOTICE
,
"
return type %s
is only a shell"
,
returnTypeName
);
returnTypeName
);
}
}
...
@@ -236,7 +236,7 @@ ProcedureCreate(char *procedureName,
...
@@ -236,7 +236,7 @@ ProcedureCreate(char *procedureName,
prosrc
=
procedureName
;
prosrc
=
procedureName
;
if
(
fmgr_internal_function
(
prosrc
)
==
InvalidOid
)
if
(
fmgr_internal_function
(
prosrc
)
==
InvalidOid
)
elog
(
ERROR
,
elog
(
ERROR
,
"
ProcedureCreate: there is no built
in function named
\"
%s
\"
"
,
"
there is no built-
in function named
\"
%s
\"
"
,
prosrc
);
prosrc
);
}
}
...
...
src/backend/catalog/pg_type.c
View file @
8265769c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.6
1 2001/03/22 06:16:11 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.6
2 2001/08/10 15:49:39 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -304,7 +304,7 @@ TypeCreate(char *typeName,
...
@@ -304,7 +304,7 @@ TypeCreate(char *typeName,
typeObjectId
=
TypeGet
(
typeName
,
&
defined
);
typeObjectId
=
TypeGet
(
typeName
,
&
defined
);
if
(
OidIsValid
(
typeObjectId
)
&&
if
(
OidIsValid
(
typeObjectId
)
&&
(
defined
||
assignedTypeOid
!=
InvalidOid
))
(
defined
||
assignedTypeOid
!=
InvalidOid
))
elog
(
ERROR
,
"
TypeCreate: type %s already defined
"
,
typeName
);
elog
(
ERROR
,
"
type named %s already exists
"
,
typeName
);
/*
/*
* if this type has an associated elementType, then we check that it
* if this type has an associated elementType, then we check that it
...
@@ -314,7 +314,7 @@ TypeCreate(char *typeName,
...
@@ -314,7 +314,7 @@ TypeCreate(char *typeName,
{
{
elementObjectId
=
TypeGet
(
elementTypeName
,
&
defined
);
elementObjectId
=
TypeGet
(
elementTypeName
,
&
defined
);
if
(
!
defined
)
if
(
!
defined
)
elog
(
ERROR
,
"
TypeCreate: type %s is not defined
"
,
elementTypeName
);
elog
(
ERROR
,
"
type %s does not exist
"
,
elementTypeName
);
}
}
/*
/*
...
@@ -464,7 +464,7 @@ TypeCreate(char *typeName,
...
@@ -464,7 +464,7 @@ TypeCreate(char *typeName,
{
{
/* should not happen given prior test? */
/* should not happen given prior test? */
if
(
assignedTypeOid
!=
InvalidOid
)
if
(
assignedTypeOid
!=
InvalidOid
)
elog
(
ERROR
,
"
TypeCreate: type %s already defined
"
,
typeName
);
elog
(
ERROR
,
"
type %s already exists
"
,
typeName
);
tup
=
heap_modifytuple
(
tup
,
tup
=
heap_modifytuple
(
tup
,
pg_type_desc
,
pg_type_desc
,
...
@@ -530,12 +530,12 @@ TypeRename(const char *oldTypeName, const char *newTypeName)
...
@@ -530,12 +530,12 @@ TypeRename(const char *oldTypeName, const char *newTypeName)
PointerGetDatum
(
oldTypeName
),
PointerGetDatum
(
oldTypeName
),
0
,
0
,
0
);
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tuple
))
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
ERROR
,
"
TypeRename: type
\"
%s
\"
not defined
"
,
oldTypeName
);
elog
(
ERROR
,
"
type %s does not exist
"
,
oldTypeName
);
if
(
SearchSysCacheExists
(
TYPENAME
,
if
(
SearchSysCacheExists
(
TYPENAME
,
PointerGetDatum
(
newTypeName
),
PointerGetDatum
(
newTypeName
),
0
,
0
,
0
))
0
,
0
,
0
))
elog
(
ERROR
,
"
TypeRename: type
\"
%s
\"
already defined
"
,
newTypeName
);
elog
(
ERROR
,
"
type named %s already exists
"
,
newTypeName
);
namestrcpy
(
&
(((
Form_pg_type
)
GETSTRUCT
(
tuple
))
->
typname
),
newTypeName
);
namestrcpy
(
&
(((
Form_pg_type
)
GETSTRUCT
(
tuple
))
->
typname
),
newTypeName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment