Can not update view

316 views Asked by At

I am using PgAdmin 4 with PostgreSQL 12. Below is a simple tabledefinition vocabulary and a view vocabulary_input. When I use the SELECT - statement from the vocabulary_input in the Query-tool screen, I can update and add rows. However, when I choose "View / Edit data -- all rows" from vocabulary_input the view is locked. Why is that?

    CREATE TABLE public.vocabulary
    (
        entry text COLLATE pg_catalog."default" NOT NULL,
        description text COLLATE pg_catalog."default",
        reference text COLLATE pg_catalog."default" NOT NULL,
        CONSTRAINT vocabulary_pkey PRIMARY KEY (entry, reference)
    );


    CREATE OR REPLACE VIEW public.vocabulary_input
        AS
        SELECT vocabulary.entry,
        vocabulary.description,
        vocabulary.reference
        FROM vocabulary
        ORDER BY vocabulary.entry, vocabulary.reference;
1

There are 1 answers

0
cvz On

I have posted this question at the developers site of pgadmin with the question if this is a bug or "expected behavior". This is the answer: "I am rejecting this RM, as in the future we will get rid of View/Edit data. We will enhance the query tool further, given that we can edit in place in the query tool."

So, my conclusion is that's is an interface issue and has nothing to do with SQL. See: https://redmine.postgresql.org/issues/5532