Hi Andres,

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

commit eb68379c38202180bc8e33fb9987284e314b7fc8
Author: Andres Freund <and...@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.ge15...@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

Attachment: fix_make_error_with_BKI_FORCE_NULL.patch
Description: application/download

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to