Re: extension_control_path and "directory"

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Cc: Christoph Berg <myon(at)debian(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: extension_control_path and "directory"
Date: 2025-04-29 14:08:26
Message-ID: E36A12DF-B8F7-4D48-AAD2-90A8A1220BA5@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Apr 29, 2025, at 09:49, Matheus Alcantara <matheusssilv97(at)gmail(dot)com> wrote:

> Yes, it is a single path from the search path, in your case it will be
> "/Users/david/Downloads/share/postgresql" and "$system". We split these
> paths based on the system path separator and get the next "piece" here:
>
> char *piece = first_path_var_separator(ecp);
>
> The first_path_var_separator() changes the "ecp" parameter on every call,
> it returns the next path on "ecp" and changes it to have the remaining
> paths to iterate over it.

Right. My point is a minor one, but I thin you can use an if/ else there:

```c
if (strcmp(piece, "$system") == 0) {
/* Substitute the path macro if needed */
mangled = substitute_path_macro(piece, "$system", system_dir);
} else {
/*
* Append "extension" suffix in case is a custom extension
* control path.
*/
mangled = psprintf("%s/extension", mangled);
}
```

Best,

David

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2025-04-29 14:26:50 Re: pgsql: doc: clarify new behavior of max_files_per_process
Previous Message Andres Freund 2025-04-29 13:52:03 Re: pgsql: doc: clarify new behavior of max_files_per_process

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-04-29 14:34:42 Re: ZStandard (with dictionaries) compression support for TOAST compression
Previous Message David E. Wheeler 2025-04-29 13:59:47 Re: RFC: Additional Directory for Extensions