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

Function lo_creat

src/interfaces/libpq/fe-lobj.c:443–469  ·  view source on GitHub ↗

* lo_creat * create a new large object * the mode is ignored (once upon a time it had a use) * * returns the oid of the large object created or * InvalidOid upon failure */

Source from the content-addressed store, hash-verified

441 * InvalidOid upon failure
442 */
443Oid
444lo_creat(PGconn *conn, int mode)
445{
446 PQArgBlock argv[1];
447 PGresult *res;
448 int retval;
449 int result_len;
450
451 if (lo_initialize(conn) < 0)
452 return InvalidOid;
453
454 argv[0].isint = 1;
455 argv[0].len = 4;
456 argv[0].u.integer = mode;
457 res = PQfn(conn, conn->lobjfuncs->fn_lo_creat,
458 &retval, &result_len, 1, argv, 1);
459 if (PQresultStatus(res) == PGRES_COMMAND_OK)
460 {
461 PQclear(res);
462 return (Oid) retval;
463 }
464 else
465 {
466 PQclear(res);
467 return InvalidOid;
468 }
469}
470
471/*
472 * lo_create

Callers 3

importFileFunction · 0.85
importFileFunction · 0.85
lo_import_internalFunction · 0.85

Calls 4

lo_initializeFunction · 0.85
PQfnFunction · 0.85
PQresultStatusFunction · 0.85
PQclearFunction · 0.85

Tested by 2

importFileFunction · 0.68
importFileFunction · 0.68