Partition table with a foreign key self-reference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

I need help with the process of partitioning tables.

How can I partition a table that has a foreign key that references itself?

Something like this example:

CREATE TABLE employees (
    employee_id SERIAL PRIMARY KEY,
    name VARCHAR(50),
    boss_id INTEGER,
    CONSTRAINT fk_boss FOREIGN KEY (boss_id) REFERENCES employees(employee_id)
);

I'm using Postgresql 14.

Thanks!

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux