我正在使用copy將csv文件導入到postgres中,其中一個字段包含HH:MM:SS formate中的時間值。我希望能夠將其設置爲TIMESTAMP字段,我已經瀏覽了大量文檔,但我正在努力研究將其設置爲的字段類型。我看到很多關於創建帶有時區的字段,日期等的信息,而不是我之後的信息。最終目標是基於時間間隔創建報告,例如, 00:00:00到06:30:00之間的所有數據等Postgres TIMESTAMP查詢
0
A
回答
5
postgres中的時間戳記是日期和時間的組合。對於時間只能使用類型時間或時間與時區。
0
下面是一個例子:
CREATE TABLE table01
(
rowid bigint NOT NULL,
time_field time without time zone,
CONSTRAINT table01_pkey PRIMARY KEY (rowid)
)
WITH (
OIDS=FALSE
);
這裏是一個文件,例如:
100,12:30:59
200,08:59:01
可以使用copy
命令這樣importe這最後文件table01
:
COPY table01 from 'c:/tmp/table01.txt' with csv
考慮名爲table01.txt
的文件位於:c:/tmp/
文件夾。
參考: copy
相關問題
- 1. Exasol SQL TIMESTAMP查詢
- 2. 查詢where timestamp <timestamp not working?
- 3. 查詢Oracle TIMESTAMP WITH TIMEZONE
- 4. ORACLE-查詢關於TIMESTAMP
- 5. 主義查詢<timestamp
- 6. Postgres Timestamp列與Java util.Date
- 7. Slow Postgres查詢
- 8. ,Postgres的查詢
- 9. 優化postgres查詢
- 10. Postgres查詢優化
- 11. Laravel/Postgres db查詢?
- 12. ,Postgres的查詢optmization
- 13. Postgres查詢問題
- 14. 格式查詢postgres
- 15. 加快postgres查詢
- 16. Postgres查詢調整
- 17. Postgres,nodejs SELECT查詢
- 18. 優化Postgres查詢
- 19. 查詢來檢查的Postgres
- 20. Postgres在postgres查詢上的實時查詢事件
- 21. Postgres,查詢子查詢的結果?
- 22. 將postgres查詢轉換爲django查詢
- 23. 使用node-postgres查詢postgres db
- 24. 休眠等同於TIMESTAMP查詢
- 25. ORACLE:查詢表(類型TIMESTAMP)的表
- 26. JPA timestamp列和net.sf.json結果從查詢
- 27. HBase - 如何基於key-timestamp-id查詢?
- 28. Postgres date_trunc(text,timestamp)與Symfony中的Doctrine 2?
- 29. node-postgres LEFT JOIN查詢
- 30. 日誌postgres查詢消息
不僅在Postgres的,我會說。 http://www.google.com/search?q=define%3Atimestamp – leonbloy