0

Can we set fillfactor on postgres view?

I have created one view as

CREATE VIEW test_view AS
SELECT ut.test2_parent_id, ut.test2_id
FROM test1 as u
JOIN test2 as ut ON u.id = ut.test2_parent_id
JOIN test3 as t ON ut.test2_id = t.id;

In another psql script I am trying to set fillfactor = 70 on all tables which are there in my schema.

But when I run that script I get an error as

Message : ERROR: unrecognized parameter "fillfactor"
Where: SQL statement "ALTER TABLE test_view SET (fillfactor = 70)"
PL/pgSQL function inline_code_block line 13 at EXECUTE

So my question here is , can we not set fillfactor on view tables?

I looked for references online but unable to find any reference which says we can not set fillfactor on tables created as view.

1 Answer 1

1

A view is not actual storage - there is no table on the physical storage. A view is a way to hide complexity on the data structures resulting in simpler looking queries - however the data is still pulled from the original tables.

Given that no storage exists fill_factor doesn't make sense for a view.

Not the answer you're looking for? Browse other questions tagged or ask your own question.