Re: multi-install PostgresNode fails with older postgres versions

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: multi-install PostgresNode fails with older postgres versions
Дата
Msg-id
20210422150954.GA9206@alvherre.pgsql
Ответ на
Список
Дерево обсуждения
multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Amit Kapila <amit.kapila16@gmail.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Amit Kapila <amit.kapila16@gmail.com>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Tom Lane <tgl@sss.pgh.pa.us>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Amit Kapila <amit.kapila16@gmail.com>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Tom Lane <tgl@sss.pgh.pa.us>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Michael Paquier <michael@paquier.xyz>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Andrew Dunstan <andrew@dunslane.net>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
Re: multi-install PostgresNode fails with older postgres versions Mark Dilger <mark.dilger@enterprisedb.com>
On 2021-Apr-21, Andrew Dunstan wrote:

> +=head1 DESCRIPTION
> +
> +PostgresVersion encapsulated Postgres version numbers, providing parsing
> +of common version formats and comparison operations.

Small typo here: should be "encapsulates"

> +	# Accept standard formats, in case caller has handed us the output of a
> +	# postgres command line tool
> +	$arg = $1
> +		if ($arg =~ m/\(?PostgreSQL\)? (\d+(?:\.\d+)*(?:devel)?)/);
> +
> +	# Split into an array
> +	my @result = split(/\./, $arg);
> +
> +	# Treat development versions as having a minor/micro version one less than
> +	# the first released version of that branch.
> +	if ($result[$#result] =~ m/^(\d+)devel$/)
> +	{
> +		pop(@result);
> +		push(@result, $1, -1);
> +	}

It's a bit weird to parse the "devel" bit twice.  Would it work to leave
(?:devel)? out of the capturing parens that becomes $1 in the first
regex and make it capturing itself, so you get "devel" in $2, and decide
based on its presence/absence?  Then you don't have to pop and push a -1.

> +	my $res = [ @result ];

Hmm, isn't this just \@result?  So you could do
	return bless \@result, $class;

-- 
Álvaro Herrera                            39°49'30"S 73°17'W


В списке pgsql-hackers по дате отправления
От: Zhihong Yu
Дата:
Сообщение: Re: TRUNCATE on foreign table
От: Andrew Dunstan
Дата:
FAQ