* FindDefaultConversionProc - find default encoding conversion proc */
| 3872 | * FindDefaultConversionProc - find default encoding conversion proc |
| 3873 | */ |
| 3874 | Oid |
| 3875 | FindDefaultConversionProc(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. |