"Farid Zidan" <farid(at)zidsoft(dot)com> writes:
> If you use keyword 'distinct' for the source select of the insert statement
> the insert fails. Insert succeeds if 'distinct' is not used in select list.
This isn't a bug, it's a consequence of the fact that you're not
specifying the types of the literal constants. DISTINCT forces
the parser to assign a data type to the constants (otherwise there
is no way to understand what duplicate-elimination means) and what
it will fall back to is "text". Try attaching an explicit cast,
eg
'2010-04-30 00:00:00'::timestamp
regards, tom lane