1

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?

vic
  • 292
  • 3
  • 14
  • I would not expect a high level DBMS independent tool like LibreOffice to be able to alter/change the structure of tables for all databases it supports connecting to. So I guess this is just a matter of "not implemented". –  Jan 18 '16 at 21:14
  • You're probably right. I just tried connecting MS Access to it using ODBC and it behaves even worse. But pgadmin is pretty good actually, will just stick to using it instead - at least for the data definition. To work with the actual data, Base seems to be not such a bad choice, though. – vic Jan 19 '16 at 00:31
  • To clarify: [pgAdmin](http://pgadmin.org/) is a [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) app for administering a Postgres cluster (collection of databases). The pgAdmin app is open-source and free-of-cost. You can use other tools instead, but pgAdmin is a good start for beginners. Handy for pros too, as it often comes bundled with Postgres installations. You can define your tables and columns as well as query and view data. – Basil Bourque Jan 20 '16 at 03:41
  • Hi Basil, since you consider pgadmin mostly "a good start for beginners", I'm curious as to what other, more advanced or simply better tools you use to administer Postgres? – vic Jan 20 '16 at 09:36
  • You can also copy and paste a table, and in the dialog that pops up there is an option to change the column definitions. Possibly you could make a copy of the table with your changes and then delete the old table. – Lyrl Jan 25 '16 at 17:22

1 Answers1

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?

Community
  • 1
  • 1
Jim K
  • 12,824
  • 2
  • 22
  • 51