函数to_char()中的错误!! [英] Bug in function to_char() !!

查看:100
本文介绍了函数to_char()中的错误!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PostgreSQL 7.3.2


有一个错误的日期''2005-03-27''!!!!!!!!! !!!!!!!!!!!!!!!!!!

SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'');

to_char

------------

26/03/2005

(1行)


我得到的日期是2005年3月26日而不是27/03/2005!


对于其他日期,该功能运作良好!!

Hi, i am using PostgreSQL 7.3.2

there''s a bug for the date ''2005-03-27'' !!!!!!!!!!!!!!!!!!!!!!!!!!!

SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
26/03/2005
(1 row)

I get the date 26/03/2005 instead of 27/03/2005 !!!

For other dates the function works well !!

推荐答案

Najib Abi Fadel写道:
Najib Abi Fadel wrote:
我正在使用PostgreSQL 7.3.2

有一个错误的日期''2005-03-27''!!!!!!!!!!! !!!!!!!!!!!!!!!!


我认为您应该更换或清洁键盘。至少有一把钥匙

似乎很粘。

SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'' );
to_char
------------
26/03/2005
(1排)
Hi, i am using PostgreSQL 7.3.2

there''s a bug for the date ''2005-03-27'' !!!!!!!!!!!!!!!!!!!!!!!!!!!
I think you should replace or clean your keyboard. At least one key
seems to be sticky.
SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
26/03/2005
(1 row)




7.2.1和7.4.1没问题。 (周围没有7.3.2)。

两者都正常工作:


dirk => SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'');

to_char

------ ------

27/03/2005

(1排)


-

D irk Forsterling
r@zorbla.de http://r.zorbla.de/

-------------

放射性猫有十八个半衰期。


------------------- --------(广播结束)---------------------------

提示3 :如果通过Usenet发布/阅读,请发送适当的

subscribe-nomail命令到 ma *** ****@postgresql.org 以便您的

消息可以干净地通过邮件列表



No problem with 7.2.1 and 7.4.1. (don''t have a 7.3.2 around).
Both work correctly:

dirk=> SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
27/03/2005
(1 row)

--
D i r k F "o r s t e r l i n g
r@zorbla.de http://r.zorbla.de/
-------------
"A radioactive cat has eighteen half-lives."

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


2004年7月1日星期四上午09:47:38 +0200,Najib Abi Fadel写道:
On Thu, Jul 01, 2004 at 09:47:38AM +0200, Najib Abi Fadel wrote:
我正在使用PostgreSQL 7.3.2

那里' 2005-03-27的日期错误!!!!!!!!!!!!!!!!!!!!!!!!!!!

SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'');
to_char
------------ 26/03/2005
(1排)

我的日期是2005年3月26日而不是27/03/2005 !!!
Hi, i am using PostgreSQL 7.3.2

there''s a bug for the date ''2005-03-27'' !!!!!!!!!!!!!!!!!!!!!!!!!!!

SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
26/03/2005
(1 row)

I get the date 26/03/2005 instead of 27/03/2005 !!!


< br $>
7.5devel:


#SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'');

to_char

------------

27/03/2005

日期看起来像夏令时变化的某个日期,

也许它已经知道并修复了。


你能检查以下结果:


#SELECT''2005-03-27'':: timestamp;

时间戳

------ ---------------

2005-03-27 00:00:00


#SHOW TIMEZONE;

TimeZone

---------------

欧洲/布拉格

Karel


-

Karel Zak< za *** @ zf.jcu.cz> ;
http://home.zf.jcu.cz/~ zakkr /


---------------------------(播出结束) ---------------------------

提示5:您是否检查了我们广泛的常见问题解答?

http://www.postgresql.org/docs/faqs /FAQ.html



7.5devel:

# SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
27/03/2005
The date looks like some date when is daylight saving time change,
maybe it''s something already knows and fixed.

Can you check results of:

# SELECT ''2005-03-27''::timestamp;
timestamp
---------------------
2005-03-27 00:00:00

# SHOW TIMEZONE;
TimeZone
---------------
Europe/Prague
Karel

--
Karel Zak <za***@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


2004年7月1日星期四上午09:53:34 +0200,

Dirk F?rsterling< r@zorbla.de>写了

33行的消息说:
On Thu, Jul 01, 2004 at 09:53:34AM +0200,
Dirk F?rsterling <r@zorbla.de> wrote
a message of 33 lines which said:
7.2.1和7.4.1没问题。 (周围没有7.3.2)。
No problem with 7.2.1 and 7.4.1. (don''t have a 7.3.2 around).




7.3.4似乎没问题所以我认为带有惊叹号的家伙没有

输入他发送的内容:


%psql template1

欢迎使用PostgreSQL交互式终端psql 7.3.4。

输入:\copyright for distribution terms

\ h获取有关SQL命令的帮助

\?有关内部斜杠命令的帮助

\ g或以分号结束执行查询

\ q退出


template1 => SELECT to_char(''2005-03-27'':: date,''DD / MM / YYYY'');

to_char

------ ------

27/03/2005

(1排)

----------- ----------------(广播结束)---------------------------

提示8:解释分析是你的朋友



7.3.4 seems OK so I assume the guy with the exclamation marks did not
type what he sent:

% psql template1
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

template1=> SELECT to_char(''2005-03-27''::date,''DD/MM/YYYY'');
to_char
------------
27/03/2005
(1 row)
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


这篇关于函数to_char()中的错误!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆