Search Postgresql Archives

Re: Blank, nullable date column rejected by psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rich Shepard <rshepard@xxxxxxxxxxxxxxx> writes:
> In a .sql file to insert rows in this table psql has a problem when there's
> no value for the next_contact column:

> $ psql -f activities.sql -d bustrac 
> psql:activities.sql:6: ERROR:  invalid input syntax for type date: ""
> LINE 2: ...ise. Asked him to call.',''),

> Explicitly replacing the blank field ('') with null is accepted. Why is
> this?

An empty string is not a null.

(Oracle has done untold damage to the field by failing to make this
distinction ... but in theory, and in the SQL standard, and in Postgres,
they're not at all the same thing.)

			regards, tom lane




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux