-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
table row type and query-specified row type do not match on insert #74
Comments
Hi, @Envek! Your problem usually arises when tuple descriptor (i.e. schema, existing and deleted attributes) of parent table doesn't correspond to child's one. You can check this fact by executing the following query for parent and attached child tables: select attname, attnum, attisdropped
from pg_attribute
where attrelid='<table_name>'::regclass and compare their attributes. We're working on this issue. Stay tuned. |
Oh yes, now I can see that one of the earlier migrations dropped one column before migration with pg_pathman:
On the staging and production databases there is no dropped column:
I think it because of |
UPDATE: we've come up with a fix, but it's not publicly available yet. We're going to test it for a while. |
A have some issue after drop columns at parent table and at all child's. DO
$$
DECLARE
row RECORD;
i RECORD;
BEGIN
FOR row IN SELECT
relname,
relpages
FROM pg_tables
JOIN pg_class ON tablename = relname
WHERE schemaname = 'main' AND tablename LIKE 'content%'
ORDER BY relname
LOOP
SELECT
count(*)
FILTER (WHERE attisdropped != TRUE) AS non_droped,
count(*)
FILTER (WHERE attisdropped = TRUE) AS dropped
FROM pg_attribute
WHERE attrelid = row.relname :: REGCLASS
INTO i;
IF i.non_droped != 11 OR i.dropped != 2
THEN
RAISE NOTICE '% % %', row.relname, i.non_droped, i.dropped;
END IF;
END LOOP;
END;
$$; Output nothing. But get error at insert in parent table any way:
But direct insert in partition work well. Some other output:
|
Well add "pg_pathman.enable_partitionfilter = off" fix insert issue. |
Hi @kataev, It doesn't fix anything, you're just inserting values into parent table. As I've already mentioned, we're working on a bugfix (branch |
Thank you for quick answer and help. Code from branch really helps, thank you very much! |
to @kataev,
Good, thanks for testing it. Don't forget to perform a clean installation after we've released 1.3. Our beta releases cannot be upgraded safely. |
Fixed. |
Confirmed. Thank you! |
Hi all.
While playing with something on virtual machines I've encountered weird error from pg_pathman while trying to insert a record into partitioned table:
Steps to reproduce:
Install PostgreSQL 9.5.5 from apt.postgresql.org on Ubuntu Linux 14.04
Install pg_pathman 1.2.1:
Create database and set up tables
Set up pg_pathman
All commands executed successfully and in server logs appeared
At this point of time all tables are empty.
Try to insert record:
Which fails with next error:
Both parent and child tables look the same. These exact setup and this exact query is working in production on pg_pathman 1.1 and on staging environment on pg_pathman 1.2.1 upgraded from 1.1, but on virtual environment with fresh install is broken.
\d+
for parent table (tracker_points
):\d+
for target child table (tracker_points_2017_01
):Am I configured something wrong? How to debug this?
Thank you in advance.
The text was updated successfully, but these errors were encountered: