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

Function GetExtTableEntryIfExists

src/backend/access/external/external.c:180–201  ·  view source on GitHub ↗

* Like GetExtTableEntry(Oid), but returns NULL instead of throwing * an error if no pg_foreign_table entry is found. */

Source from the content-addressed store, hash-verified

178 * an error if no pg_foreign_table entry is found.
179 */
180ExtTableEntry*
181GetExtTableEntryIfExists(Oid relid)
182{
183 ForeignTable *ft;
184 ExtTableEntry *extentry;
185
186 /* do nothing if it's not an external table */
187 if (!rel_is_external_table(relid))
188 return NULL;
189
190 ft = GetForeignTable(relid);
191
192 /* options array is always populated, {} if no options set */
193 if (ft->options == NULL)
194 elog(ERROR, "could not find options for external protocol");
195
196 extentry = GetExtFromForeignTableOptions(ft->options, relid);
197
198 pfree(ft);
199
200 return extentry;
201}
202
203ExtTableEntry *
204GetExtFromForeignTableOptions(List *ftoptons, Oid relid)

Callers 3

ATExecAttachPartitionFunction · 0.85
GpPolicyFetchFunction · 0.85
GetExtTableEntryFunction · 0.85

Calls 4

rel_is_external_tableFunction · 0.85
GetForeignTableFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected