Re: Having a problem with RoR-3.1.1 and Pg-9.1 - Mailing list pgsql-general

From James B. Byrne
Subject Re: Having a problem with RoR-3.1.1 and Pg-9.1
Date
Msg-id 6323c3cf20daaf399059c55d91bed0be.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Re: Having a problem with RoR-3.1.1 and Pg-9.1  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: Having a problem with RoR-3.1.1 and Pg-9.1
Re: Having a problem with RoR-3.1.1 and Pg-9.1
List pgsql-general
On Mon, February 27, 2012 13:54, Adrian Klaver wrote:
> On 02/27/2012 08:51 AM, James B. Byrne wrote:
>>
>> The options seem to be run the script as the owner of
>> the
>> plpgsql EXTENSION or do not include the comment.
>>
>> How does one instruct pg_dump not to include the COMMENT
>> for the plpgsql extension?
>
> I am not sure pg_dump is including the COMMENT. From your
> previous post the source of the COMMENT would seem to be
> development_structure.sql, which I assume is coming from
> RoR.
>

RoR is using pg_dump to create development_structure.sql.
A direct invocation of pg_dump -s from the command line
gives this output.

.  .  .
COMMENT ON SCHEMA public IS 'standard public schema';


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA
pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural
language';

.  .  .

So, RoR is simply trying to deal with what Pg is providing
it.

The questions are:

1. Can the comments be suppressed? If so then how are the
COMMENT statements suppressed within Pg itself or
pg_dump?.  The development_structure.sql is regenerated
automatically so editing that file is futile.

2. Why is this an error in the first place?  Surely a
warning is sufficient if a comment cannot be applied.

3. Why are these dependencies not owned by the database
owner to begin with?  Surely this code:

CREATE EXTENSION plpgsql
  SCHEMA pg_catalog
  VERSION "1.0";
ALTER EXTENSION plpgsql
  OWNER TO postgres;

could just as easily specify the actual database owner
instead?


--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


pgsql-general by date:

Previous
From: Mike Blackwell
Date:
Subject: Orphaned temp table
Next
From: "James B. Byrne"
Date:
Subject: Re: Having a problem with RoR-3.1.1 and Pg-9.1