Обсуждение: Re: Extension disappearing act

Поиск
Список
Период
Сортировка

Re: Extension disappearing act

От
Adrian Klaver
Дата:
On 6/19/25 06:09, Dominique Devienne wrote:
> Hi. Little mystery we don't understand. v17.
> 
> Create new DB, owned by dedicated new ROLE.
> Create extension (pgcrypto) in our case. Installed in public, owned by
> DB owner role.
> Create schemas and populate them inside the DB.
> This also creates roles associated to those schemas.
> One of the schema is owned by the DB owner (in case that matters).
> Creates functions using pgcrypto, in some of those schemas.
> Drop all schemas (and associated roles), thus pgcrypto-using functins are gone.

Does 'all' include the public schema?

> Of course, the DB owner role was not dropped. Can't in fact.
> Somehow, the pgcrypto extension has disappeared, as side-effects of the drops.

Was it in fact installed in the public schema?


> TIA, --DD
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: Extension disappearing act

От
Dominique Devienne
Дата:
On Thu, Jun 19, 2025 at 4:18 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> On 6/19/25 06:09, Dominique Devienne wrote:
> > Hi. Little mystery we don't understand. v17.
> Does 'all' include the public schema?

No. We don't touch `public` at all, beside pgcrypto ending up inside it.

> > Of course, the DB owner role was not dropped. Can't in fact.
> > Somehow, the pgcrypto extension has disappeared, as side-effects of the drops.
>
> Was it in fact installed in the public schema?

Sure was. It's my own command, but good enough. --DD

D:\>ppg -c my17 -d dd_v168a database_ --extensions
Connected OK (postgresql://ddevienne@localhost:5417/dd_v168a)
=======================================================
|   Name   | Version |       Owner       |   Schema   |
=======================================================
| pgcrypto | 1.3     | "Acme-DBA:000ik2" | public     |
| plpgsql  | 1.0     | postgres          | pg_catalog |
=======================================================
2 installed extensions (out of 61)

Which runs

SELECT extname, extversion,
       extowner::regrole::text as owner,
       extnamespace::regnamespace::text as "schema"
  FROM pg_extension
 ORDER BY 1



Re: Extension disappearing act

От
Adrian Klaver
Дата:
On 6/19/25 07:54, Dominique Devienne wrote:
> On Thu, Jun 19, 2025 at 4:18 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>> On 6/19/25 06:09, Dominique Devienne wrote:
>>> Hi. Little mystery we don't understand. v17.
>> Does 'all' include the public schema?
> 
> No. We don't touch `public` at all, beside pgcrypto ending up inside it.
> 
>>> Of course, the DB owner role was not dropped. Can't in fact.
>>> Somehow, the pgcrypto extension has disappeared, as side-effects of the drops.
>>
>> Was it in fact installed in the public schema?
> 
> Sure was. It's my own command, but good enough. --DD
> 
> D:\>ppg -c my17 -d dd_v168a database_ --extensions
> Connected OK (postgresql://ddevienne@localhost:5417/dd_v168a)
> =======================================================
> |   Name   | Version |       Owner       |   Schema   |
> =======================================================
> | pgcrypto | 1.3     | "Acme-DBA:000ik2" | public     |
> | plpgsql  | 1.0     | postgres          | pg_catalog |
> =======================================================
> 2 installed extensions (out of 61)
> 
> Which runs
> 
> SELECT extname, extversion,
>         extowner::regrole::text as owner,
>         extnamespace::regnamespace::text as "schema"
>    FROM pg_extension
>   ORDER BY 1

After you run the DROP commands the above query does not return 
pgcrypto, correct?

-- 
Adrian Klaver
adrian.klaver@aklaver.com