Re: pg_largeobject.sql script not run after upgrade

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Stuart Ford <stuart(dot)ford(at)glide(dot)uk(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_largeobject.sql script not run after upgrade
Date: 2013-06-24 13:00:17
Message-ID: 20130624130017.GA25964@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 24, 2013 at 08:51:46AM -0400, Bruce Momjian wrote:
> On Mon, Jun 24, 2013 at 11:13:08AM +0000, Stuart Ford wrote:
> > Dear community
> >
> > Last week we upgraded our database from 8.4 to 9.1. The upgrade seemed to
> > go fine and the database seems to have been working fine ever since
> > (around a week now).
> >
> > However, today I noticed the output from the pg_upgrade command contained
> > the following:
> >
> > | Your installation contains large objects.
> > | The new database has an additional large object
> > | permission table so default permissions must be
> > | defined for all large objects. The file:
> > | /tmp/pg_largeobject.sql
> > | when executed by psql by the database super-user
> > | will define the default permissions.
> >
> > I missed this at the time, my fault, it was at the end of a stressful
> > migration evening.
> >
> > Is it safe to run this script now, a week in to using the upgraded
> > database? Can this be done while the database is live?
>
> Sure, you can run it anytime. Until you run it your large object
> permissions might not be accurate.

Looking further, here is the command that is executed:

SELECT pg_catalog.lo_create(t.loid)
FROM (SELECT DISTINCT loid FROM pg_catalog.pg_largeobject) AS t;

If you have created _new_ large objects since the upgrde, the script
might throw an error, as there is already metadata for those large
objects. You might need to delete the rows in pg_largeobject_metadata
before running the script; this will reset all the large object
permissions to default.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-06-24 13:39:18 Re: postgres_fdw changes schema search path
Previous Message Bruce Momjian 2013-06-24 12:51:46 Re: pg_largeobject.sql script not run after upgrade