バージョンごとのドキュメント一覧

B.6. 単位の歴史 #

<title>History of Units</title>

The SQL standard states that <quote>Within the definition of a <quote>datetime literal</quote>, the <quote>datetime values</quote> are constrained by the natural rules for dates and times according to the Gregorian calendar</quote>. <productname>PostgreSQL</productname> follows the SQL standard's lead by counting dates exclusively in the Gregorian calendar, even for years before that calendar was in use. This rule is known as the <firstterm>proleptic Gregorian calendar</firstterm>. 標準SQLでは、「日付時刻リテラル定義の中で、日付時刻の値はグレゴリオ暦に従った日付と時間の自然法則に則る」と明記されています。 PostgreSQLは標準SQLの指針に従い、グレゴリオ暦が使われる以前の年に対してもグレゴリオ暦で日付を数えます。 この規則は先発グレゴリオ暦として知られています。

The Julian calendar was introduced by Julius Caesar in 45 BC. It was in common use in the Western world until the year 1582, when countries started changing to the Gregorian calendar. In the Julian calendar, the tropical year is approximated as 365 1/4 days = 365.25 days. This gives an error of about 1 day in 128 years. ユリウス暦は、紀元前45年にユリウス・カエサル(Julius Caesar)によって広められたものです。 西欧でグレゴリオ暦への移行が開始された1582年まで一般的に使用されていました。 ユリウス暦では、太陽年は365日+1/4日=365.25日と概算されます。 この暦では、128年で約1日のずれが生じます。

The accumulating calendar error prompted Pope Gregory XIII to reform the calendar in accordance with instructions from the Council of Trent. In the Gregorian calendar, the tropical year is approximated as 365 + 97 / 400 days = 365.2425 days. Thus it takes approximately 3300 years for the tropical year to shift one day with respect to the Gregorian calendar. ローマ教皇グレゴリウス13世(Gregory XIII)はトレントの公会議(Council of Trent)の勧告に従って累積していた暦のずれを修正しました。 グレゴリオ暦では、太陽年は365+97/400日=365.2425日と近似されます。 したがって、グレゴリオ暦で太陽年が1日ずれるにはおよそ3,300年を要します。

The approximation 365+97/400 is achieved by having 97 leap years every 400 years, using the following rules: 365+97/400という近似は、下記の規則に従って400年間に97回のうるう年を設けることによって得られています。

Every year divisible by 4 is a leap year. 4で割り切れる年を、うるう年にする。
However, every year divisible by 100 is not a leap year. ただし、100で割り切れる年は、うるう年にしない。
However, every year divisible by 400 is a leap year after all. ただし、400で割り切れる年は、結局うるう年とする。

So, 1700, 1800, 1900, 2100, and 2200 are not leap years. But 1600, 2000, and 2400 are leap years. したがって、1700、1800、1900、2100、2200はうるう年ではありませんが、1600、2000、2400はうるう年です。 By contrast, in the older Julian calendar all years divisible by 4 are leap years. それに比べ、古いユリウス暦では4で割り切れる年のみがうるう年でした。

The papal bull of February 1582 decreed that 10 days should be dropped from October 1582 so that 15 October should follow immediately after 4 October. This was observed in Italy, Poland, Portugal, and Spain. Other Catholic countries followed shortly after, but Protestant countries were reluctant to change, and the Greek Orthodox countries didn't change until the start of the 20th century. The reform was observed by Great Britain and its dominions (including what is now the USA) in 1752. Thus 2 September 1752 was followed by 14 September 1752. This is why Unix systems that have the <command>cal</command> program produce the following: 1582年2月の教皇勅書は、1582年の10月から10日間除外することを命じ、したがって10月4日の翌日を10月15日としました。 この慣行はイタリア、ポーランド、ポルトガル、スペインで遵守されました。 他のカトリックの国々もすぐ後に追従しましたが、プロテスタントの国々は変更を嫌がり、ギリシャ正教を信奉する国々は20世紀の初めまで変更を行いませんでした。 1752年に大英帝国とその自治領(現在のアメリカ合衆国を含む)でもその改革は行われました。 したがって、1752年9月2日の次は1752年9月14日となっています。 このような理由から、Unixシステムでcalプログラムを実行すると、下記のような結果になります。

$ cal 9 1752
   September 1752
 S  M Tu  W Th  F  S
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

But, of course, this calendar is only valid for Great Britain and dominions, not other places. Since it would be difficult and confusing to try to track the actual calendars that were in use in various places at various times, <productname>PostgreSQL</productname> does not try, but rather follows the Gregorian calendar rules for all dates, even though this method is not historically accurate. しかし、当然、この暦は大英帝国とその自治領でのみ有効なものであり、他の場所ではそうではありません。 様々な場所で様々な時代に使われていた実際の暦を追いかけることは難しく、また、混乱することになるでしょうから、PostgreSQLは追いかけることはせず、この方法が歴史的に正確でなくても日付すべてでグレゴリオ暦の規則に従います。

Different calendars have been developed in various parts of the world, many predating the Gregorian system. For example, the beginnings of the Chinese calendar can be traced back to the 14th century BC. Legend has it that the Emperor Huangdi invented that calendar in 2637 BC. The People's Republic of China uses the Gregorian calendar for civil purposes. The Chinese calendar is used for determining festivals. グレゴリオ暦が開発されるより前から、様々な暦が世界の多くの地域で開発されました。 例えば、中国暦のルーツは紀元前14世紀まで遡ることができますし、伝説では、黄帝が紀元前2637年にこの暦を発明したとされています。 中華人民共和国では、公的な目的ではグレゴリオ暦を使用していますが、祝祭日の決定には中国暦を使用します。