Foreign table created with inherits stuck

I've been trying to create a foreign table in my PSQL database. The point here is to concatenate the same steps table from 2 different databases. I want to use INHERITS to copy the schema.

I have a steps table locally, and a steps table (with millions of lines) on my cache_server. I've tried to create the foreign table with:

CREATE FOREIGN TABLE cache_steps  ()
INHERITS (steps)
SERVER cache_server 
OPTIONS ( schema_name 'public', table_name 'steps');

The thing is when I do that, the local steps table becomes unusable, there's no lock but it loads forever, I can't do any request to this table. I don't understand why this inheritance has any impact on my steps table.

If I create my foreign table with the schema instead of inherits, everything works fine

CREATE FOREIGN TABLE cache_steps  (
    column1 text,
    column2 text
)
SERVER cache_server 
OPTIONS ( schema_name 'public', table_name 'steps')


Read more here: https://stackoverflow.com/questions/64890795/foreign-table-created-with-inherits-stuck

Content Attribution

This content was originally published by RobinFrcd at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: