官术网_书友最值得收藏!

Importing data using psql

Psql is the pgsql's command-line tool. While one can achieve quite a lot with GUI based database management utilities, psql is very useful when one needs to handle database backups, management and alike via scripting. When there is no GUI installed on the server, psql becomes pretty much the only option so it is worth being familiar with it even if you're not a fan.

In order to import the data in psql we will use a \COPY command. This requires us to define the data model for the incoming data first.

Defining the table data model from a text file may be prone to errors that will prevent data from being imported. If for of some reason you are not sure what data types are stored in the particular columns of your source file you can import all the data as text and then re-cast it as required at a later time.

主站蜘蛛池模板: 东平县| 顺昌县| 申扎县| 水富县| 会东县| 射洪县| 江口县| 鹤峰县| 大连市| 东乌珠穆沁旗| 九江市| 金湖县| 庄河市| 银川市| 广安市| 灵璧县| 浦北县| 元阳县| 兴山县| 五河县| 出国| 海丰县| 海伦市| 靖边县| 松阳县| 平武县| 丰原市| 阳新县| 屯门区| 涿鹿县| 获嘉县| 云安县| 砚山县| 盐亭县| 通山县| 钟山县| 商河县| 南乐县| 会同县| 永善县| 江油市|