Skip to content

ERROR: could not find junk tableoid1 column #129

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

Closed
DmitriyAr opened this issue Oct 6, 2017 · 10 comments
Closed

ERROR: could not find junk tableoid1 column #129

DmitriyAr opened this issue Oct 6, 2017 · 10 comments
Labels
Milestone

Comments

@DmitriyAr
Copy link

Steps to reproduce:

CREATE TABLE public._journal (
    id      SERIAL,
    dt      TIMESTAMP NOT NULL,
    level   INTEGER,
    msg     TEXT);
    
CREATE OR REPLACE VIEW public.journal AS SELECT * FROM public._journal;

CREATE INDEX ON public._journal(dt);

INSERT INTO public._journal (dt, level, msg)
SELECT g, random() * 6, md5(g::text)
FROM generate_series('2016-01-01'::date, '2016-12-31'::date, '1 minute') as g;   

SELECT public.create_range_partitions('public._journal', 'dt', '2016-01-01'::date, '1 month'::interval);
********** Error **********

ERROR: could not find junk tableoid1 column
SQL state: XX000

If disable pg_pathman for the table:

SELECT public.disable_pathman_for('public._journal'::regclass);

SELECT .. FOR UPDATE is OK.

@funbringer
Copy link
Collaborator

HI @DmitriyAr,

I'm sorry, but I couldn't reproduce your issue on PostgreSQL 9.5, 9.6 and 10. What exactly is broken? SELECT .. FOR UPDATE or create_range_partitions or maybe something else?

@funbringer
Copy link
Collaborator

Also, could you show us your PostgreSQL and pg_pathman's versions?

@DmitriyAr
Copy link
Author

Sorry I ommited the last statement which caused the error
SELECT * FROM public.journal WHERE id = 1 FOR UPDATE;

PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17), 64-bit
pg_pathman 1.4.5

@funbringer
Copy link
Collaborator

Thanks, now the problem is obvious to me. Let's see what we can do.

@DmitriyAr
Copy link
Author

Unfortunately I found that my issue #77 is not have been solved.

CREATE OR REPLACE FUNCTION public.f_journal_tr ()
RETURNS trigger AS
$$
BEGIN
  RAISE EXCEPTION '%', TG_OP;
  RETURN NULL;
END;
$$
LANGUAGE 'plpgsql';

CREATE TRIGGER journal_tr
  INSTEAD OF INSERT OR UPDATE OR DELETE 
  ON public.journal FOR EACH ROW 
  EXECUTE PROCEDURE public.f_journal_tr();
    
update public.journal set dt = CURRENT_DATE where id = 1; 

If pg_pathman is enabled for this table the exception does not occur

@funbringer
Copy link
Collaborator

Why do you mix several problems in a single issue? You could reply to #77.

@DmitriyAr
Copy link
Author

No problem.
It seems the both issues have same root cause.

@funbringer
Copy link
Collaborator

It seems the both issues have same root cause.

Unfortunately, it's not quite true.

@funbringer
Copy link
Collaborator

Pushed a bunch of fixes to master branch. Could you test it?

@DmitriyAr
Copy link
Author

It works. Thanks.

@funbringer funbringer added this to the Release 1.4.7 milestone Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants