Re: Variable substitution in psql backtick expansion
| От | Fabien COELHO |
|---|---|
| Тема | Re: Variable substitution in psql backtick expansion |
| Дата | |
| Msg-id | alpine.DEB.2.20.1704022144470.9265@lancre обсуждение исходный текст |
| Ответ на | Re: Variable substitution in psql backtick expansion (Corey Huinker <corey.huinker@gmail.com>) |
| Список | pgsql-hackers |
> src/tools/msvc/Solution.pm:s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x)
> #x\n#define __STRINGIFY2(z) __STRINGIFY(z)\n#define PG_VERSION_STR
> "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build "
> __STRINGIFY2(_MSC_VER) ", $bits-bit"};
Well, this is the same hack.
> Without digging too deep, it seems like the redefinition wouldn't be
> harmful, but it might make sense to not use the name STRINGIFY() if only to
> avoid confusion with Solution.pm.
It is the usual name for these macro. What would you suggest?
>> - how desirable/useful is it to have this in 10?
>
> Extensions and extension-ish packages will love the _NUM vars.
Hmmmm. I'm afraid pg extension scripts (for CREATE EXTENSION) are not
executed through psql, but server side directly, so there is not much
backslash-command support.
> There's a lesser need for the _NAME vars.
I put them more for error reporting, eg:
\if :VERSION_NUM < 110000 \echo :VERSION_NAME is not supported, should be at least 11.0 \q \endif
--
Fabien.
В списке pgsql-hackers по дате отправления: