Possible to change PostgreSQL table design using L

2019-07-23 01:33发布

问题:

I read that LibreOffice Base has a native Postgres driver, so I thought that might be a good way to play around with the database structure, creating new tables, altering and dropping existing ones etc.

Almost everything seems to work fine. I can connect to the DB and open and edit all tables, create new ones, delete existing ones. I can basically do everything, except change the data definition of existing columns. So, I could delete the column entirely, and I can easily create new columns in the same table. But once they're there, I cannot change them anymore, the respective options are greyed out in Base.

Could this be a bug or am I missing something else?

回答1:

In LO Base, it is not possible to modify existing columns using the graphical tools.

Instead, go to Tools -> SQL in the main menu bar. This will show a dialog where you can enter an ALTER TABLE command. For example (from the postgres docs):

ALTER TABLE distributors RENAME COLUMN address TO city;

See also Modifying table entries from LibreOffice Base, possible?