Re: Extend compatibility of PostgreSQL::Test::Cluster

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: Extend compatibility of PostgreSQL::Test::Cluster
Дата
Msg-id 87lf00oifg.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: Extend compatibility of PostgreSQL::Test::Cluster  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Extend compatibility of PostgreSQL::Test::Cluster  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:

> +        my $subclass = __PACKAGE__ . "::V_$maj";
> +        bless $node, $subclass;
> +        unless ($node->isa(__PACKAGE__))
> +        {
> +            # It's not a subclass, so re-bless back into the main package
> +            bless($node, __PACKAGE__);
> +            carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
> +        }

The ->isa() method works on package names as well as blessed objects, so
the back-and-forth blessing can be avoided.

    my $subclass = __PACKAGE__ . "::V_$maj";
    if ($subclass->isa(__PACKAGE__))
    {
        bless($node, $subclass);
    }
    else
    {
        carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    }

- ilmari



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hans Buschmann
Дата:
Сообщение: AW: Introducing PgVA aka PostgresVectorAcceleration using SIMD vector instructions starting with hex_encode
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Extend compatibility of PostgreSQL::Test::Cluster