Re: NOT NULL markings for BKI columns

Поиск
Список
Период
Сортировка
От Jeevan Chalke
Тема Re: NOT NULL markings for BKI columns
Дата
Msg-id CAM2+6=VPoow5PqgqiTjPX4QNeokb7op8aD_8Zg3QnHZMvvU0GQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: NOT NULL markings for BKI columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: NOT NULL markings for BKI columns  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Hi Andres,

Following commit (related to this discussion),
added a bug when we use BKI_FORCE_NULL.

commit eb68379c38202180bc8e33fb9987284e314b7fc8
Author: Andres Freund <andres@anarazel.de>
Date:   Sat Feb 21 22:25:49 2015 +0100

    Allow forcing nullness of columns during bootstrap.

    Bootstrap determines whether a column is null based on simple builtin
    rules. Those work surprisingly well, but nonetheless a few existing
    columns aren't set correctly. Additionally there is at least one patch
    sent to hackers where forcing the nullness of a column would be helpful.

    The boostrap format has gained FORCE [NOT] NULL for this, which will be
    emitted by genbki.pl when BKI_FORCE_(NOT_)?NULL is specified for a
    column in a catalog header.

    This patch doesn't change the marking of any existing columns.

    Discussion: 20150215170014.GE15326@awork2.anarazel.de


Specifically, this code chunk:

+                   if (defined $attopt)
+                   {
+                       if ($attopt eq 'PG_FORCE_NULL')
+                       {
+                           $row{'forcenull'} = 1;
+                       }
+                       elsif ($attopt eq 'BKI_FORCE_NOT_NULL')
+                       {
+                           $row{'forcenotnull'} = 1;
+                       }
+                       else
+                       {
+                           die "unknown column option $attopt on column $attname"
+                       }
+                   }


In case of BKI_FORCE_NULL, it is ending up in else part and throwing an error.

We should have BKI_FORCE_NULL instead of PG_FORCE_NULL in the comparison.

Attached patch which does that.

Thanks

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Вложения

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

Предыдущее
От: Max Filippov
Дата:
Сообщение: Re: configure can't detect proper pthread flags
Следующее
От: Dmitry Voronin
Дата:
Сообщение: ConfigData in postgresql.conf