Re: assert pg_class.relnatts is consistent

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: assert pg_class.relnatts is consistent
Дата
Msg-id 20200214151301.GA6618@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: assert pg_class.relnatts is consistent  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
I propose this more concise coding for AddDefaultValues,

    # Now fill in defaults, and note any columns that remain undefined.
    foreach my $column (@$schema)
    {
        my $attname = $column->{name};
        my $atttype = $column->{type};

        # Skip if a value already exists
        next if defined $row->{$attname};

        # 'oid' and 'relnatts' are special cases. Ignore.
        next if $attname eq 'oid';
        next if $attname eq 'relnatts';

        # This column has a default value.  Fill it in.
        if (defined $column->{default})
        {
            $row->{$attname} = $column->{default};
            next;
        }

        # Failed to find a value.
        push @missing_fields, $attname;
    }

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Fix compiler warnings on 64-bit Windows
Следующее
От: Darafei "Komяpa" Praliaskouski
Дата:
Сообщение: Re: BRIN cost estimate breaks geometric indexes