MCPcopy Create free account
hub / github.com/apache/cloudberry / FindDefaultConversionProc

Function FindDefaultConversionProc

src/backend/catalog/namespace.c:3874–3896  ·  view source on GitHub ↗

* FindDefaultConversionProc - find default encoding conversion proc */

Source from the content-addressed store, hash-verified

3872 * FindDefaultConversionProc - find default encoding conversion proc
3873 */
3874Oid
3875FindDefaultConversionProc(int32 for_encoding, int32 to_encoding)
3876{
3877 Oid proc;
3878 ListCell *l;
3879
3880 recomputeNamespacePath();
3881
3882 foreach(l, activeSearchPath)
3883 {
3884 Oid namespaceId = lfirst_oid(l);
3885
3886 if (namespaceId == myTempNamespace)
3887 continue; /* do not look in temp namespace */
3888
3889 proc = FindDefaultConversion(namespaceId, for_encoding, to_encoding);
3890 if (OidIsValid(proc))
3891 return proc;
3892 }
3893
3894 /* Not found in path */
3895 return InvalidOid;
3896}
3897
3898/*
3899 * recomputeNamespacePath - recompute path derived variables if needed.

Callers 6

PrepareClientEncodingFunction · 0.85
InitializeClientEncodingFunction · 0.85
BeginCopyFromFunction · 0.85
test_enc_conversionFunction · 0.85

Calls 3

recomputeNamespacePathFunction · 0.85
FindDefaultConversionFunction · 0.85
foreachFunction · 0.50

Tested by 1

test_enc_conversionFunction · 0.68