Re: schema diff tool problem with owner statements

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: postgresql(at)yawebhost(dot)com
Cc: "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: schema diff tool problem with owner statements
Date: 2021-11-12 05:58:30
Message-ID: CANxoLDerKQW6mJhk2cf_swh6ixWULTr29y=X4tdEJRL9J_LMbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi

On Fri, Nov 12, 2021 at 12:45 AM <postgresql(at)yawebhost(dot)com> wrote:

> I'm trying to compare 2 schemas (devschema is the source and testschema
> is the target) and generate a script that can be run on the target that
> will create the missing tables. I ran the schema diff, and it generated
> items like this:
>
> CREATE TABLE IF NOT EXISTS tablename
> (
> fields, etc
> )
> TABLESPACE pg_default;
>
> ALTER TABLE IF EXISTS public.tablename
> OWNER to devschema;
>
>
> When I run the script on testschema, I don't want it trying to alter the
> owner of the table because that statement will fail anyway.
>
> I found a setting in "preferences" called "ignore owner", and set it to
> true (If set to True, then the Schema Diff tool ignores the owner while
> comparing the objects.)
>
> However, this setting has no effect. The alter table statements still
> get generated, and I am left to remove them manually.
>
> If there is something I'm doing wrong please let me now. I swear this
> setting worked many months ago when I used this tool, but it seems to
> not be working now.
>
> Version 6.1 (downloaded and updated today)
>

This is by design, as at the time of comparison or generating the
script we can't check the owner is exist on the target schema or not.
Consider the case where the owner exists and the user wants to run the same
DDL statement. I think the user needs to manually change the owner. There
is a find and replace option in the query tool by which we can easily
replace.

>
> Thank you,
>
> Wes
>
>
>
>

--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message postgresql 2021-11-12 15:17:03 Re: schema diff tool problem with owner statements
Previous Message postgresql 2021-11-11 19:14:55 schema diff tool problem with owner statements