mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Additional fixes for large object access control.
Use pg_largeobject_metadata.oid instead of pg_largeobject.loid to enumerate existing large objects in pg_dump, pg_restore, and contrib modules.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.42 2009/07/13 22:56:30 momjian Exp $
|
||||
* $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.43 2009/12/14 00:39:10 itagaki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -142,7 +142,10 @@ vacuumlo(char *database, struct _param * param)
|
||||
*/
|
||||
buf[0] = '\0';
|
||||
strcat(buf, "CREATE TEMP TABLE vacuum_l AS ");
|
||||
strcat(buf, "SELECT DISTINCT loid AS lo FROM pg_largeobject ");
|
||||
if (PQserverVersion(conn) >= 80500)
|
||||
strcat(buf, "SELECT oid AS lo FROM pg_largeobject_metadata");
|
||||
else
|
||||
strcat(buf, "SELECT DISTINCT loid AS lo FROM pg_largeobject");
|
||||
res = PQexec(conn, buf);
|
||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||
{
|
||||
|
Reference in New Issue
Block a user