Re: Statistics Import and Export - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=cmGmuocZzW1GRsQKSQ6hU4dnP=TYogkhU7ZPEUkTZU2A@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (jian he <jian.universality@gmail.com>)
Responses Re: Statistics Import and Export
List pgsql-hackers
However, this function seems to accept -1 for the relpages parameter. Below is an example of execution:
---
postgres=> CREATE TABLE data1(c1 INT PRIMARY KEY, c2 VARCHAR(10));
CREATE TABLE
postgres=> SELECT pg_set_relation_stats('data1', relpages=>-1);
 pg_set_relation_stats
-----------------------
 t
(1 row)
postgres=> SELECT relname, relpages FROM pg_class WHERE relname='data1';
 relname | relpages
---------+----------
 data1   |       -1
(1 row)
---

The attached patch modifies the pg_set_relation_stats function to work as described in the manual.

Regards,
Noriyoshi Shinoda

Accepting -1 is correct. I thought I had fixed that in a recent patch. Perhaps signals got crossed somewhere along the way.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ECPG cleanup and fix for clang compile-time problem
Next
From: Kirill Reshke
Date:
Subject: Re: Consider the number of columns in the sort cost model