PostGresql table edit in command line
2013-11-05
To edit the Istsos database table “measures” in PostgreSQL it is to overcome to the error in istsos import saying the Dylos reading is exceeding the digit limit of the column val_meas in the table. Normally it is easy to change column digit size through pgadmin. However, for command line, it requires following commands.
Get access to PostgreSQL
sudo -u postres psqlTo view the database in PostgreSQL
\dtTo connect with a particular database
\c istsos here istsos is databaseTo display the details of table
\d dlyosecbe.measrues here dlyosecbe.measrues is the table nameTo change the columns digit size use the SQl command got from pgadmin
ALTER TABLE dyloscbe.measures k ALTER COLUMN val_msr TYPE numeric(14,6);