PostgreSQL: CreationDateTime and LastUpdateToPayPerRequestDateTime carry microseconds, where DynamoDB sends milliseconds

オープン 初心者向け
#1,036 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
postgresql, rust
領域
databases

調査の方向性

crates/storage-postgres/src/create_table.rs、crates/storage-postgres/src/table_helpers.rs、crates/storage-postgres/src/delete_table.rsを読み、creation_date_timeをエポックからの秒数として取り出すクエリに注目してください。issueの提案どおり、これらのクエリ結果をミリ秒単位に切り捨て、CreateTable、DescribeTable、UpdateTable、DeleteTableのレスポンスを対象とするPostgreSQLのテストを確認してください。変更前に作成されたテーブルも含め、これらの日付の小数点以下が最大3桁になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

On the PostgreSQL backend, CreateTable, DescribeTable and UpdateTable send CreationDateTime as epoch seconds with microseconds. DescribeTable sends the same value as BillingModeSummary.LastUpdateToPayPerRequestDateTime. Amazon DynamoDB sends every date member as epoch seconds with at most three decimal places.

Measured in us-east-1 on 2026-11-14 and 2026-11-16, with each response body read as text. On 2026-11-14 each request went out twice, and every date member of both answers had three decimal places. The requests were a CreateTable of an on-demand table (pk S HASH, BillingMode PAY_PER_REQUEST), a DescribeTable once it was ACTIVE, and a CreateBackup of it. A second table got a CreateTable with ProvisionedThroughput 5/7, then an UpdateTable that raised it to 9/11. DynamoDB writes the numbers in exponent form. The ExtendDB column gives the numbers as ExtendDB sent them on PostgreSQL:

Member DynamoDB, 2026-11-14 ExtendDB on PostgreSQL
CreateTable TableDescription.CreationDateTime 1.794674022596E9 1794835907.194914
DescribeTable Table.CreationDateTime 1.794674022596E9 1794835907.194914
DescribeTable Table.BillingModeSummary.LastUpdateToPayPerRequestDateTime 1.794674022596E9 1794835907.194914
CreateBackup BackupDetails.BackupCreationDateTime 1.794674033829E9 1794835908.235
UpdateTable TableDescription.CreationDateTime of the second table 1.794674033901E9 1794835908.25337

ExtendDB at origin/main 95425f5e8 gives these answers on PostgreSQL. A second run gave 1794836584.375861 and 1794836585.48558. The other backends send at most three decimal places: SQLite, SQLite in dev mode and MongoDB send whole seconds, and Cassandra sends milliseconds (1794836695.516).

create_table.rs (crates/storage-postgres/src/create_table.rs) stores creation_date_time as NOW() (line 262) in a TIMESTAMPTZ column (crates/storage-postgres/migrations/0001_baseline.sql, line 40), which keeps microseconds. The insert returns EXTRACT(EPOCH FROM creation_date_time)::FLOAT8 (line 269). build_table_description_on (crates/storage-postgres/src/table_helpers.rs, line 133) reads the column the same way at line 142, and build_table_description_from_row (line 190) copies the value into LastUpdateToPayPerRequestDateTime at line 306. The DeleteTable query reads it the same way (crates/storage-postgres/src/delete_table.rs, line 49). BackupCreationDateTime has three decimal places because pg_timestamp_to_epoch (crates/storage-postgres/src/backup_engine.rs, line 56) converts a whole-millisecond instant as milliseconds over 1000, and a backup's creation time is a whole millisecond.

Proposed change: truncate the creation time to the millisecond in the three queries that read it, for example EXTRACT(EPOCH FROM date_trunc('milliseconds', creation_date_time))::FLOAT8. Tables created before the change then also answer with at most three decimal places.

主要言語
Rust
スター
517
フォーク
60
平均マージ
5日 14時間
マージ済み PR(30日)
124

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ExtendDB/extenddb のほかの issue

ExtendDB/extenddb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。