::date cast error
От | Jan Stavárek |
---|---|
Тема | ::date cast error |
Дата | |
Msg-id | Fx0.Zjhj.1sBNZrjT2iA.1JELnY@seznam.cz обсуждение исходный текст |
Ответы |
Re: ::date cast error
|
Список | pgsql-bugs |
<p>Hello,<p>I think I might have come accross a bug. <p><br /><p>Having following table:<p><br /><p>CREATE TABLE general.materialtransaction<br/>(<br /> type integer NOT NULL,<br /> articleid integer NOT NULL,<br /> date timestampwithout time zone NOT NULL,<br /> personid integer NOT NULL,<br /> note text,<br /> id serial NOT NULL,<br /> CONSTRAINT materialtransaction_pkey PRIMARY KEY (id),<br /> CONSTRAINT fk_personid FOREIGN KEY (personid)<br /> REFERENCES general.person (id) MATCH SIMPLE<br /> ON UPDATE NO ACTION ON DELETE NO ACTION<br />)<br /><p><br/>both queries<p><br /><p>SELECT Date FROM General.MaterialTransaction WHERE Date::date = '2014-03-30'<p><br /><p>and<p><br /><p>SELECT Date FROM General.MaterialTransaction WHERE CAST(Date AS date) = '2014-03-30'<p><br /><p>workwell in pgAdmin, but on only the second one works in my application (using C#, 4.0 .NET Framework and NpqSql). Thefirst one emits a "syntax error at or near ":" error in the application. I'm using the latest versions of both PostgreSQLand Npqsql.<p><br /><p>I will also let know the NpqSql team about this issue as I'm not really sure where the rootcause might be. Maybe it is my fault, but the behaviour seems odd to me. At this moment it is not a critical issue forme, since I can use the second approach, but I wanted you to know about it.<p><br /><p>Also, since this is my first e-mailto you, I would like to thank you (the whole team) for all the efford you put into PostgreSQL. I'm happy that somethinglike this exists!<p><br /><p>Best Regards,<p>Jan Stavarek
В списке pgsql-bugs по дате отправления: