Search code examples
pgadmin-4postgresql-14

Why does PgAdmin 4 (v 6.1) not allow me to Add Data in the GUI>


I am using PgAdmin4 v 6.1 on Mac OSX Monterrey 12.1 and I cannot add data in the GUI. Why can i not add the data?

I created my first table in the Gui And defined 3 columns

I cannot add a row in the GUI using Rt Click <edit First 100> The Return query is all read only and the columns have lock icons?

here is the table create sql:

   - Table: public.products
-- DROP TABLE IF EXISTS public.products;
CREATE TABLE IF NOT EXISTS public.products
(
    name character varying COLLATE pg_catalog."default" NOT NULL,
    price integer NOT NULL,
    id integer NOT NULL DEFAULT nextval('products_id_seq'::regclass)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.products
    OWNER to postgres;

The UI path to get to the locked edit screen: enter image description here

here is the image of the screen with lock icons: enter image description here

I was able to write insert SQL and add a row. But I still cannot edit that row in the GUI.


Solution

  • I made one Column the Primary Key and I was able to Edit + Add Data

    Here is the new SQL for Table Create:

     CREATE TABLE IF NOT EXISTS public.products
    (
        name character varying COLLATE pg_catalog."default" NOT NULL,
        price integer NOT NULL,
        id integer NOT NULL DEFAULT nextval('products_id_seq'::regclass),
        CONSTRAINT products_pkey PRIMARY KEY (id)
    )