Skip to content
Snippets Groups Projects
Commit d49108fd authored by Tatsuo Ishii's avatar Tatsuo Ishii
Browse files

Add FindDefaultConversionProc

parent 30ec3160
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.24 2002/07/12 18:43:15 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.25 2002/07/16 06:58:14 ishii Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -26,6 +26,7 @@
#include "catalog/dependency.h"
#include "catalog/heap.h"
#include "catalog/namespace.h"
#include "catalog/pg_conversion.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_opclass.h"
......@@ -1268,6 +1269,28 @@ PopSpecialNamespace(Oid namespaceId)
namespaceSearchPathValid = false;
}
/*
* FindDefaultConversionProc - find default encoding cnnversion proc
*/
Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding)
{
Oid proc;
List *lptr;
recomputeNamespacePath();
foreach(lptr, namespaceSearchPath)
{
Oid namespaceId = (Oid) lfirsti(lptr);
proc = FindDefaultConversion(namespaceId, for_encoding, to_encoding);
if (OidIsValid(proc))
return proc;
}
/* Not found in path */
return InvalidOid;
}
/*
* recomputeNamespacePath - recompute path derived variables if needed.
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: namespace.h,v 1.15 2002/06/20 20:29:43 momjian Exp $
* $Id: namespace.h,v 1.16 2002/07/16 06:58:13 ishii Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -75,6 +75,8 @@ extern bool isTempNamespace(Oid namespaceId);
extern void PushSpecialNamespace(Oid namespaceId);
extern void PopSpecialNamespace(Oid namespaceId);
extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding);
/* initialization & transaction cleanup code */
extern void InitializeSearchPath(void);
extern void AtEOXact_Namespace(bool isCommit);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment