0

我在 Mac OSX Monterrey 12.1 上使用 PgAdmin4 v 6.1,我无法在 GUI 中添加数据。为什么我不能添加数据?

我在 Gui 中创建了我的第一个表并定义了 3 列

我无法使用 Rt Click 在 GUI 中添加一行 <edit First 100> 返回查询都是只读的并且列有锁定图标?

这是表创建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;

进入锁定编辑屏幕的 UI 路径: 在此处输入图像描述

这是带有锁定图标的屏幕图像: 在此处输入图像描述

我能够编写插入 SQL 并添加一行。但我仍然无法在 GUI 中编辑该行。

4

1 回答 1

0

我将一列设为主键,并且能够编辑 + 添加数据

这是创建表的新 SQL:

 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)
)
于 2022-01-29T23:12:47.927 回答