Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd49108f

Browse files
committed
Add FindDefaultConversionProc
1 parent30ec316 commitd49108f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

‎src/backend/catalog/namespace.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.24 2002/07/12 18:43:15 tgl Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.25 2002/07/16 06:58:14 ishii Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -26,6 +26,7 @@
2626
#include"catalog/dependency.h"
2727
#include"catalog/heap.h"
2828
#include"catalog/namespace.h"
29+
#include"catalog/pg_conversion.h"
2930
#include"catalog/pg_inherits.h"
3031
#include"catalog/pg_namespace.h"
3132
#include"catalog/pg_opclass.h"
@@ -1268,6 +1269,28 @@ PopSpecialNamespace(Oid namespaceId)
12681269
namespaceSearchPathValid= false;
12691270
}
12701271

1272+
/*
1273+
* FindDefaultConversionProc - find default encoding cnnversion proc
1274+
*/
1275+
OidFindDefaultConversionProc(int4for_encoding,int4to_encoding)
1276+
{
1277+
Oidproc;
1278+
List*lptr;
1279+
1280+
recomputeNamespacePath();
1281+
1282+
foreach(lptr,namespaceSearchPath)
1283+
{
1284+
OidnamespaceId= (Oid)lfirsti(lptr);
1285+
1286+
proc=FindDefaultConversion(namespaceId,for_encoding,to_encoding);
1287+
if (OidIsValid(proc))
1288+
returnproc;
1289+
}
1290+
1291+
/* Not found in path */
1292+
returnInvalidOid;
1293+
}
12711294

12721295
/*
12731296
* recomputeNamespacePath - recompute path derived variables if needed.

‎src/include/catalog/namespace.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: namespace.h,v 1.15 2002/06/20 20:29:43 momjian Exp $
10+
* $Id: namespace.h,v 1.16 2002/07/16 06:58:13 ishii Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -75,6 +75,8 @@ extern bool isTempNamespace(Oid namespaceId);
7575
externvoidPushSpecialNamespace(OidnamespaceId);
7676
externvoidPopSpecialNamespace(OidnamespaceId);
7777

78+
externOidFindDefaultConversionProc(int4for_encoding,int4to_encoding);
79+
7880
/* initialization & transaction cleanup code */
7981
externvoidInitializeSearchPath(void);
8082
externvoidAtEOXact_Namespace(boolisCommit);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp