* buildShSecLabels * * Build SECURITY LABEL command(s) for a shared object * * The caller has to provide object type and identity in two separate formats: * catalog_name (e.g., "pg_database") and object OID, as well as * type name (e.g., "DATABASE") and object name (not pre-quoted). * * The command(s) are appended to "buffer". */
| 2454 | * The command(s) are appended to "buffer". |
| 2455 | */ |
| 2456 | static void |
| 2457 | buildShSecLabels(PGconn *conn, const char *catalog_name, Oid objectId, |
| 2458 | const char *objtype, const char *objname, |
| 2459 | PQExpBuffer buffer) |
| 2460 | { |
| 2461 | PQExpBuffer sql = createPQExpBuffer(); |
| 2462 | PGresult *res; |
| 2463 | |
| 2464 | buildShSecLabelQuery(catalog_name, objectId, sql); |
| 2465 | res = executeQuery(conn, sql->data); |
| 2466 | emitShSecLabels(conn, res, buffer, objtype, objname); |
| 2467 | |
| 2468 | PQclear(res); |
| 2469 | destroyPQExpBuffer(sql); |
| 2470 | } |
| 2471 | |
| 2472 | /* |
| 2473 | * Make a database connection with the given parameters. An |
no test coverage detected