Bug: The "directory" control parameter does not work

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Bug: The "directory" control parameter does not work
Date: 2024-01-26 21:40:29
Message-ID: C86FCCFD-0C84-4F70-BA54-72C04A2F69DF@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

I wanted to try to customize the subdirectory for an extension. The docs[1] say:

> directory (string)
>
> The directory containing the extension's SQL script file(s). Unless an absolute path is given, the name is relative to the installation's SHAREDIR directory. The default behavior is equivalent to specifying directory = 'extension'.

[1]: https://www.postgresql.org/docs/16/extend-extensions.html

But it doesn’t seem to work. I tried this experiment:

❯ pg_config --version
PostgreSQL 16.1

❯ git clone git(at)github(dot)com:theory/kv-pair.git
❯ cd kv-pair
❯ echo directory = 'blah' >> pair.control
❯ cat pair.control
# pair extension
comment = 'A key/value pair data type'
default_version = '0.1.2'
module_pathname = '$libdir/pair'
relocatable = true
directory = blah

❯ make install
cp sql/pair.sql sql/pair--0.1.2.sql
/opt/homebrew/bin/gmkdir -p '/Users/david/.pgenv/pgsql-16.1/share/extension'
/opt/homebrew/bin/gmkdir -p '/Users/david/.pgenv/pgsql-16.1/share/extension'
/opt/homebrew/bin/gmkdir -p '/Users/david/.pgenv/pgsql-16.1/share/doc/extension'
/opt/homebrew/bin/ginstall -c -m 644 .//pair.control '/Users/david/.pgenv/pgsql-16.1/share/extension/'
/opt/homebrew/bin/ginstall -c -m 644 .//sql/pair--unpackaged--0.1.2.sql '/Users/david/.pgenv/pgsql-16.1/share/extension/'
/opt/homebrew/bin/ginstall -c -m 644 .//doc/pair.md '/Users/david/.pgenv/pgsql-16.1/share/doc/extension/‘

❯ find ~/.pgenv/pgsql-16.1/ -name '*pair*.*'
/Users/david/.pgenv/pgsql-16.1//include/server/lib/pairingheap.h
/Users/david/.pgenv/pgsql-16.1//share/extension/pair--unpackaged--0.1.2.sql
/Users/david/.pgenv/pgsql-16.1//share/extension/pair.control
/Users/david/.pgenv/pgsql-16.1//share/doc/extension/pair.md

I see two problems:

1. pair--0.1.2.sql is not installed. It does install without `directory` set.
2. pair--unpackaged--0.1.2.sql is installed, but not in a `blah` directory. Shouldn’t it be?

Am I missing something?

Best,

David

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2024-01-26 22:05:42 Re: Bug: The "directory" control parameter does not work
Previous Message Eli Schwartz 2024-01-26 21:18:58 Re: make dist using git archive