Re: How to disable read-only mode on a table? (superUser)

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: celati Laurent <laurent(dot)celati(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to disable read-only mode on a table? (superUser)
Date: 2022-02-16 16:57:44
Message-ID: 695a00eb-2ff4-1460-17ec-11aa369f0db3@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/16/22 02:30, celati Laurent wrote:
> Good morning,
>
> I created a new table yesterday. I am superuser and I have all the
> rights. I had no worries yesterday to make editions on this table.
> Today all my fields are in readonly mode. As this post illustrates:
>
> https://bytes.com/topic/postgresql/answers/973206-how-remove-read-only-column-sign-postgresql
> <https://bytes.com/topic/postgresql/answers/973206-how-remove-read-only-column-sign-postgresql>
>
> I tried a reboot of the postgres services. But nothing to do. If anyone
> could help me ?

Best bet is you don't have a PRIMARY KEY on the table.

From the screenshot I'm guessing you are using pgAdmin and if I
remember correctly it only allows updates when there is PK field.

Just checked:

https://www.pgadmin.org/docs/pgadmin4/6.5/editgrid.html

"To modify the content of a table, each row in the table must be
uniquely identifiable. If the table definition does not include an OID
or a primary key, the displayed data is read only. Note that views
cannot be edited; updatable views (using rules) are not supported."

> Thank a lot.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2022-02-16 17:06:38 Re: if not exists (SELECT 1... UNION SELECT 1...)
Previous Message Adrian Klaver 2022-02-16 16:46:30 Re: Strange results when casting string to double