mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
pgindent run.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.3 2002/08/22 00:01:42 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.4 2002/09/04 20:31:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -33,19 +33,19 @@ void
|
||||
CreateConversionCommand(CreateConversionStmt *stmt)
|
||||
{
|
||||
Oid namespaceId;
|
||||
char *conversion_name;
|
||||
char *conversion_name;
|
||||
AclResult aclresult;
|
||||
int for_encoding;
|
||||
int to_encoding;
|
||||
Oid funcoid;
|
||||
Oid funcnamespace;
|
||||
char *dummy;
|
||||
char *dummy;
|
||||
|
||||
const char *for_encoding_name = stmt->for_encoding_name;
|
||||
const char *to_encoding_name = stmt->to_encoding_name;
|
||||
List *func_name = stmt->func_name;
|
||||
List *func_name = stmt->func_name;
|
||||
|
||||
static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID};
|
||||
static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID};
|
||||
|
||||
/* Convert list of names to a name and namespace */
|
||||
namespaceId = QualifiedNameGetCreationNamespace(stmt->conversion_name, &conversion_name);
|
||||
@ -64,10 +64,11 @@ CreateConversionCommand(CreateConversionStmt *stmt)
|
||||
if (to_encoding < 0)
|
||||
elog(ERROR, "Invalid to encoding name: %s", to_encoding_name);
|
||||
|
||||
/* Check the existence of the conversion function.
|
||||
* Function name could be a qualified name.
|
||||
/*
|
||||
* Check the existence of the conversion function. Function name could
|
||||
* be a qualified name.
|
||||
*/
|
||||
funcoid = LookupFuncName(func_name, sizeof(funcargs)/sizeof(Oid), funcargs);
|
||||
funcoid = LookupFuncName(func_name, sizeof(funcargs) / sizeof(Oid), funcargs);
|
||||
if (!OidIsValid(funcoid))
|
||||
elog(ERROR, "Function %s does not exist", NameListToString(func_name));
|
||||
|
||||
@ -80,8 +81,11 @@ CreateConversionCommand(CreateConversionStmt *stmt)
|
||||
aclresult = pg_proc_aclcheck(funcoid, GetUserId(), ACL_EXECUTE);
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, get_namespace_name(funcnamespace));
|
||||
|
||||
/* All seem ok, go ahead (possible failure would be a duplicate conversion name) */
|
||||
|
||||
/*
|
||||
* All seem ok, go ahead (possible failure would be a duplicate
|
||||
* conversion name)
|
||||
*/
|
||||
ConversionCreate(conversion_name, namespaceId, GetUserId(),
|
||||
for_encoding, to_encoding, funcoid, stmt->def);
|
||||
}
|
||||
@ -93,7 +97,7 @@ void
|
||||
DropConversionCommand(List *name, DropBehavior behavior)
|
||||
{
|
||||
Oid namespaceId;
|
||||
char *conversion_name;
|
||||
char *conversion_name;
|
||||
AclResult aclresult;
|
||||
|
||||
/* Convert list of names to a name and namespace */
|
||||
@ -104,9 +108,9 @@ DropConversionCommand(List *name, DropBehavior behavior)
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, get_namespace_name(namespaceId));
|
||||
|
||||
/* Go ahead (possible failure would be:
|
||||
* none existing conversion
|
||||
* not ower of this conversion
|
||||
/*
|
||||
* Go ahead (possible failure would be: none existing conversion not
|
||||
* ower of this conversion
|
||||
*/
|
||||
ConversionDrop(conversion_name, namespaceId, GetUserId(), behavior);
|
||||
}
|
||||
|
Reference in New Issue
Block a user