How to remove "read-only column" sign in Postgresql?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Adam726
    New Member
    • Oct 2019
    • 1

    How to remove "read-only column" sign in Postgresql?

    I am using postgresql 10, and when I created a table with two variables, the lock signs(shows read-only column) were shown on the columns. I am not sure if it is a reason that makes me can not import csv file into table. if so, how can I remove that?

  • Thierry42
    New Member
    • Feb 2022
    • 1

    #2
    It's an old post but some readers may encounter the same problem.

    The two locks aren't the reason that prevent the OP to import new lines from CSV.

    But if you still want to remove the "read-only column" signs, you may add a "Primary Key" (a special constraint), on your table of two columns, so you may read "[PK]" just before "character varying (50)" of your field "date".

    Without a PK, your editor (here PgAdmin4) won't know exactly on which lines write your changes.

    To add a PK on an existing table, you may try this :
    - Close the tab of the Query Editor which is showing you the "Data Output" of the table.
    - On the left panel, right-click on the table name and chose "Properties".
    - In the new dialog, select "Constraints" then "Primary Key"
    - Click on the "+" sign on the right then on the pencil at the left of the new line.
    - Then, in "General", enter a name for your PK before selecting its field(s) in "Definition".
    - Click the "Save" button on the bottom right corner of the small dialog.

    If it's OK then the locks will be replaced by pencils.

    Comment

    Working...