Re: ::date cast error
От | Pavel Stehule |
---|---|
Тема | Re: ::date cast error |
Дата | |
Msg-id | CAFj8pRCeeH+Mkd=aJOr_SvQzC99V_Mv6VGWs-Mz=4XA1nhCsVw@mail.gmail.com обсуждение исходный текст |
Ответ на | ::date cast error (Jan Stavárek <jan.stavarek@email.cz>) |
Список | pgsql-bugs |
Hello 2014-03-31 14:15 GMT+02:00 Jan Stav=C3=A1rek <jan.stavarek@email.cz>: > Hello, > > I think I might have come accross a bug. > > > Having following table: > > > CREATE TABLE general.materialtransaction > ( > type integer NOT NULL, > articleid integer NOT NULL, > date timestamp without time zone NOT NULL, > personid integer NOT NULL, > note text, > id serial NOT NULL, > CONSTRAINT materialtransaction_pkey PRIMARY KEY (id), > CONSTRAINT fk_personid FOREIGN KEY (personid) > REFERENCES general.person (id) MATCH SIMPLE > ON UPDATE NO ACTION ON DELETE NO ACTION > ) > > > both queries > > > SELECT Date FROM General.MaterialTransaction WHERE Date::date =3D > '2014-03-30' > > > and > > > SELECT Date FROM General.MaterialTransaction WHERE CAST(Date AS date) =3D > '2014-03-30' > > > work well in pgAdmin, but on only the second one works in my application > (using C#, 4.0 .NET Framework and NpqSql). The first one emits a "syntax > error at or near ":" error in the application. I'm using the latest > versions of both > PostgreSQL and Npqsql. > > > It is looking like Npgsql issue related to unhappy named column "date" - it is not keyword, but it is datatype name. > I will also let know the NpqSql team about this issue as I'm not really > sure where the root cause might be. Maybe it is my fault, but the behavio= ur > seems odd to me. At this moment it is not a critical issue for me, since = I > can use the second approach, but I wanted you to know about it. > > > if you can help - try to write some small test case and send it to Npgsql team, please Important info should be in your postgresql log. The broken query should be logged there - and should be interesting what query was sent to server. Please, attach related part of log to your test case. Also, since this is my first e-mail to you, I would like to thank you (the > whole team) for all the efford you put into PostgreSQL. I'm happy that > something like this exists! > Thank you very much, we are proud so we have happy users. Regards Pavel Stehule > > Best Regards, > > Jan Stavarek >
В списке pgsql-bugs по дате отправления: