English 中文(简体)
使用邮政局复印机的错误:“”
原标题:Error on using copy Command in Postgres (ERROR: invalid input syntax for type date: "")
  • 时间:2011-05-18 13:22:31
  •  标签:
  • postgresql

我有一份CSV档案,我试图使用Pogres COPY的指挥系统,以便从CSV档案中填写一个表格。 表一栏<代码>NEXT_VISIT为日期数据类型。 CSV档案中本应进入该日列的某些相应领域具有无效价值。

影像指挥也同样如此:

COPY "VISIT_STAGING_TABLE" from E C:\Users\Sir Codealot\Desktop\rufijihdss-2007-2010\rufijihdss\VISIT_TEST.CSV  CSV HEADER 

在我指挥下,我犯了错误:

ERROR:  invalid input syntax for type date: ""
CONTEXT:  COPY VISIT_STAGING_TABLE, line 2, column NEXT_VISIT: ""

********** Error **********
ERROR: invalid input syntax for type date: ""
SQL state: 22007
Context: COPY VISIT_STAGING_TABLE, line 2, column NEXT_VISIT: ""

我怎么能够操作复印机,获得邮政,以接受CSV档案中与对应的一些领域。 数值>?

最佳回答

我正面临同样的问题,我所要解决的问题是使用<代码>。 页: 1 重要的是不要在外向之间留有空间。

我最初使用<代码>WITH NUL,并用你所用的相同错误信息(ERROR: syntax误差 at or near “WITH NUL”)。

但是,当我消除了它所工作的热带之间的空间时。

问题回答

COPY "VISIT_STAGING_TABLE" from E C:\Users\Sir Codealot\Desktop\rufijihdss-2007-2010\rufijihdss\VISIT_TEST.CSV  WITH CSV HEADER NULL AS   

详情见postgresql COPY





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...