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
c232c8af
Commit
c232c8af
authored
Sep 25, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix notice message from DROP FUNCTION IF EXISTS, and improve message
for DROP AGGREGATE IF EXISTS. Per report from Teodor.
parent
0c858bd6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
24 deletions
+59
-24
src/backend/commands/aggregatecmds.c
src/backend/commands/aggregatecmds.c
+4
-3
src/backend/commands/functioncmds.c
src/backend/commands/functioncmds.c
+4
-6
src/backend/parser/parse_type.c
src/backend/parser/parse_type.c
+49
-14
src/include/parser/parse_type.h
src/include/parser/parse_type.h
+2
-1
No files found.
src/backend/commands/aggregatecmds.c
View file @
c232c8af
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.3
8 2006/07/27 19:52:0
4 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.3
9 2006/09/25 15:17:3
4 tgl Exp $
*
*
* DESCRIPTION
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
* The "DefineFoo" routines take the parse tree and pick out the
...
@@ -219,8 +219,9 @@ RemoveAggregate(RemoveFuncStmt *stmt)
...
@@ -219,8 +219,9 @@ RemoveAggregate(RemoveFuncStmt *stmt)
{
{
/* we only get here if stmt->missing_ok is true */
/* we only get here if stmt->missing_ok is true */
ereport
(
NOTICE
,
ereport
(
NOTICE
,
(
errmsg
(
"aggregate %s does not exist ... skipping"
,
(
errmsg
(
"aggregate %s(%s) does not exist ... skipping"
,
NameListToString
(
stmt
->
name
))));
NameListToString
(
aggName
),
TypeNameListToString
(
aggArgs
))));
return
;
return
;
}
}
...
...
src/backend/commands/functioncmds.c
View file @
c232c8af
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.7
6 2006/07/14 14:52:18 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.7
7 2006/09/25 15:17:34 tgl
Exp $
*
*
* DESCRIPTION
* DESCRIPTION
* These routines take the parse tree and pick out the
* These routines take the parse tree and pick out the
...
@@ -686,16 +686,16 @@ RemoveFunction(RemoveFuncStmt *stmt)
...
@@ -686,16 +686,16 @@ RemoveFunction(RemoveFuncStmt *stmt)
* Find the function, do permissions and validity checks
* Find the function, do permissions and validity checks
*/
*/
funcOid
=
LookupFuncNameTypeNames
(
functionName
,
argTypes
,
stmt
->
missing_ok
);
funcOid
=
LookupFuncNameTypeNames
(
functionName
,
argTypes
,
stmt
->
missing_ok
);
if
(
stmt
->
missing_ok
&&
!
OidIsValid
(
funcOid
))
if
(
!
OidIsValid
(
funcOid
))
{
{
/* can only get here if stmt->missing_ok */
ereport
(
NOTICE
,
ereport
(
NOTICE
,
(
errmsg
(
"function %s(%s) does not exist ... skipping"
,
(
errmsg
(
"function %s(%s) does not exist ... skipping"
,
NameListToString
(
functionName
),
NameListToString
(
functionName
),
NameListToString
(
argTypes
))));
Type
NameListToString
(
argTypes
))));
return
;
return
;
}
}
tup
=
SearchSysCache
(
PROCOID
,
tup
=
SearchSysCache
(
PROCOID
,
ObjectIdGetDatum
(
funcOid
),
ObjectIdGetDatum
(
funcOid
),
0
,
0
,
0
);
0
,
0
,
0
);
...
@@ -1409,8 +1409,6 @@ DropCast(DropCastStmt *stmt)
...
@@ -1409,8 +1409,6 @@ DropCast(DropCastStmt *stmt)
return
;
return
;
}
}
/* Permission check */
/* Permission check */
if
(
!
pg_type_ownercheck
(
sourcetypeid
,
GetUserId
())
if
(
!
pg_type_ownercheck
(
sourcetypeid
,
GetUserId
())
&&
!
pg_type_ownercheck
(
targettypeid
,
GetUserId
()))
&&
!
pg_type_ownercheck
(
targettypeid
,
GetUserId
()))
...
...
src/backend/parser/parse_type.c
View file @
c232c8af
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.8
3 2006/08/02 01:59:47 joe
Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.8
4 2006/09/25 15:17:34 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -141,19 +141,16 @@ LookupTypeName(ParseState *pstate, const TypeName *typename)
...
@@ -141,19 +141,16 @@ LookupTypeName(ParseState *pstate, const TypeName *typename)
}
}
/*
/*
* TypeNameToString
* appendTypeNameToBuffer
* Produce a string representing the name of a TypeName.
* Append a string representing the name of a TypeName to a StringInfo.
* This is the shared guts of TypeNameToString and TypeNameListToString.
*
*
* NB: this must work on TypeNames that do not describe any actual type;
* NB: this must work on TypeNames that do not describe any actual type;
* it is mostly used for reporting lookup errors.
* it is mostly used for reporting lookup errors.
*/
*/
char
*
static
void
TypeNameToString
(
const
TypeName
*
typename
)
appendTypeNameToBuffer
(
const
TypeName
*
typename
,
StringInfo
string
)
{
{
StringInfoData
string
;
initStringInfo
(
&
string
);
if
(
typename
->
names
!=
NIL
)
if
(
typename
->
names
!=
NIL
)
{
{
/* Emit possibly-qualified name as-is */
/* Emit possibly-qualified name as-is */
...
@@ -162,14 +159,14 @@ TypeNameToString(const TypeName *typename)
...
@@ -162,14 +159,14 @@ TypeNameToString(const TypeName *typename)
foreach
(
l
,
typename
->
names
)
foreach
(
l
,
typename
->
names
)
{
{
if
(
l
!=
list_head
(
typename
->
names
))
if
(
l
!=
list_head
(
typename
->
names
))
appendStringInfoChar
(
&
string
,
'.'
);
appendStringInfoChar
(
string
,
'.'
);
appendStringInfoString
(
&
string
,
strVal
(
lfirst
(
l
)));
appendStringInfoString
(
string
,
strVal
(
lfirst
(
l
)));
}
}
}
}
else
else
{
{
/* Look up internally-specified type */
/* Look up internally-specified type */
appendStringInfoString
(
&
string
,
format_type_be
(
typename
->
typeid
));
appendStringInfoString
(
string
,
format_type_be
(
typename
->
typeid
));
}
}
/*
/*
...
@@ -177,11 +174,49 @@ TypeNameToString(const TypeName *typename)
...
@@ -177,11 +174,49 @@ TypeNameToString(const TypeName *typename)
* LookupTypeName
* LookupTypeName
*/
*/
if
(
typename
->
pct_type
)
if
(
typename
->
pct_type
)
appendStringInfoString
(
&
string
,
"%TYPE"
);
appendStringInfoString
(
string
,
"%TYPE"
);
if
(
typename
->
arrayBounds
!=
NIL
)
if
(
typename
->
arrayBounds
!=
NIL
)
appendStringInfoString
(
&
string
,
"[]"
);
appendStringInfoString
(
string
,
"[]"
);
}
/*
* TypeNameToString
* Produce a string representing the name of a TypeName.
*
* NB: this must work on TypeNames that do not describe any actual type;
* it is mostly used for reporting lookup errors.
*/
char
*
TypeNameToString
(
const
TypeName
*
typename
)
{
StringInfoData
string
;
initStringInfo
(
&
string
);
appendTypeNameToBuffer
(
typename
,
&
string
);
return
string
.
data
;
}
/*
* TypeNameListToString
* Produce a string representing the name(s) of a List of TypeNames
*/
char
*
TypeNameListToString
(
List
*
typenames
)
{
StringInfoData
string
;
ListCell
*
l
;
initStringInfo
(
&
string
);
foreach
(
l
,
typenames
)
{
TypeName
*
typename
=
(
TypeName
*
)
lfirst
(
l
);
Assert
(
IsA
(
typename
,
TypeName
));
if
(
l
!=
list_head
(
typenames
))
appendStringInfoChar
(
&
string
,
','
);
appendTypeNameToBuffer
(
typename
,
&
string
);
}
return
string
.
data
;
return
string
.
data
;
}
}
...
...
src/include/parser/parse_type.h
View file @
c232c8af
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.3
2 2006/03/14 22:48:22
tgl Exp $
* $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.3
3 2006/09/25 15:17:34
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -22,6 +22,7 @@ typedef HeapTuple Type;
...
@@ -22,6 +22,7 @@ typedef HeapTuple Type;
extern
Oid
LookupTypeName
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
extern
Oid
LookupTypeName
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
extern
char
*
TypeNameToString
(
const
TypeName
*
typename
);
extern
char
*
TypeNameToString
(
const
TypeName
*
typename
);
extern
char
*
TypeNameListToString
(
List
*
typenames
);
extern
Oid
typenameTypeId
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
extern
Oid
typenameTypeId
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
extern
Type
typenameType
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
extern
Type
typenameType
(
ParseState
*
pstate
,
const
TypeName
*
typename
);
...
...
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