Incorrect comments in partition.c

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Incorrect comments in partition.c
Дата
Msg-id 5A671FE1.6020305@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: Incorrect comments in partition.c
Список pgsql-hackers
Here is a comment for get_qual_for_list in partition.c:

  * get_qual_for_list
  *
  * Returns an implicit-AND list of expressions to use as a list partition's
- * constraint, given the partition key and bound structures.

I don't think the part "given the partition key and bound structures."
is correct because we pass the *parent relation* and partition bound
structure to that function.  So I think we should change that part as
such.  get_qual_for_range has the same issue, so I think we need this
change for that function as well.

Another one I noticed in comments in partition.c is:

 * get_qual_for_hash
 *
 * Given a list of partition columns, modulus and remainder
corresponding to a
 * partition, this function returns CHECK constraint expression Node for
that
 * partition.

I think the part "Given a list of partition columns, modulus and
remainder corresponding to a partition" is wrong because we pass to that
function the parent relation and partition bound structure the same way
as for get_qual_for_list/get_qual_for_range.  So what about changing the
above to something like this, similarly to
get_qual_for_list/get_qual_for_range:

 Returns a CHECK constraint expression to use as a hash partition's
 constraint, given the parent relation and partition bound structure.

Also:

 * The partition constraint for a hash partition is always a call to the
 * built-in function satisfies_hash_partition().  The first two
arguments are
 * the modulus and remainder for the partition; the remaining arguments
are the
 * values to be hashed.

I also think the part "The first two arguments are the modulus and
remainder for the partition;" is wrong (see satisfies_hash_partition).
But I don't think we need to correct that here because we have described
about the arguments in comments for that function.  So I'd like to
propose removing the latter comment entirely from the above.

Attached is a proposed patch for that.

Best regards,
Etsuro Fujita

Вложения

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

Предыдущее
От: Marco Nenciarini
Дата:
Сообщение: pg_upgrade tests failing on current master
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] proposal - Default namespaces for XPath expressions(PostgreSQL 11)