Hello Sergei,

I couldn't find any case when your code doesn't work properly. So it seems ok to me.

@@ -220,6 +220,13 @@ WITH ( MODULUS <replaceable 
class="parameter">numeric_literal</replaceable>, REM
      </para>

      <para>
+      Full table scan is performed to check that no existing row
+      in the table has null values in given column.  It is possible to avoid
+      this scan by adding a valid <literal>CHECK</literal> constraint to
+      the table that would allow only NOT NULL values for given column.
+     </para>

Adding check constraint will also force the full table scan. So I think it would be better to rephrased it as follows:

"Full table scan is performed to check that column doesn't contain NULL values unless there are valid check constraints that prohibit NULL values for specified column. In the latter case table scan is skipped."

A native English speaker input would be helpful here.

Regarding regression tests it may be useful to set client_min_messages to 'debug1' before setting "NOT NULL" attribute for a column. In this case you can tell for sure that NotNullImpliedByRelConstraints() returned true (i.e. your code actually did the job) as the special debug message is printed to the log.

Thanks!

--
Ildar Musin
i.mu...@postgrespro.ru

Reply via email to