HypoPG / hypopg

Hypothetical Indexes for PostgreSQL
https://hypopg.readthedocs.io
Other
1.39k stars 59 forks source link

Server crash #1

Closed darkixion closed 9 years ago

darkixion commented 9 years ago

I get a server crash when performing the following steps on current 9.5devel:

# CREATE TABLE test (id serial, sampledate timestamp);
CREATE TABLE

# INSERT INTO test (sampledate) SELECT '1970-01-01
' 00:00:00'::timestamp + (random()*1350561945 || ' seconds')::interval
- FROM generate_series(1,21000000);
INSERT 0 21000000

# VACUUM;
VACUUM

# ANALYSE;
ANALYZE

# CREATE EXTENSION hypopg ;
CREATE EXTENSION

# SELECT * FROM hypopg_create_index('CREATE INDEX idx_test_sampledate_month ON test
' (extract(month FROM sampledate))');
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
rjuju commented 9 years ago

Hello Thom,

Thanks for the report. Hypothetical index on expression are not handled yet, but I didn't checked how it behave with it.

Commit b6baf06b67294ecb142cfa3ff526a6753b2fb415 should fix the issue, and raise a WARNING instead of crashing the server.

Regards.