From b422d9938c3c8c68317a109e285253c8f11e78b7 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Thu, 3 Jul 2025 15:08:11 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20postgres?= =?UTF-8?q?=5Fpgtype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postgres_pgtype/date.go | 3 ++- postgres_pgtype/time.go | 6 ++++-- postgres_pgtype/timestamp.go | 3 ++- postgres_pgtype/timestamptz.go | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/postgres_pgtype/date.go b/postgres_pgtype/date.go index fae9d295..2988055b 100644 --- a/postgres_pgtype/date.go +++ b/postgres_pgtype/date.go @@ -280,7 +280,8 @@ func (scanPlanTextAnyToDateScanner) Scan(src []byte, dst any) error { scanner := (dst).(pgtype.DateScanner) if src == nil { - return scanner.ScanDate(pgtype.Date{}) + return scanner.ScanDate(pgtype.Date{Valid: true}) //sanek + //return scanner.ScanDate(pgtype.Date{}) } sbuf := string(src) diff --git a/postgres_pgtype/time.go b/postgres_pgtype/time.go index 1fa61755..9b7283c0 100644 --- a/postgres_pgtype/time.go +++ b/postgres_pgtype/time.go @@ -206,7 +206,8 @@ func (scanPlanBinaryTimeToTextScanner) Scan(src []byte, dst any) error { } if src == nil { - return ts.ScanText(pgtype.Text{}) + return ts.ScanText(pgtype.Text{Valid: true}) //sanek + //return ts.ScanText(pgtype.Text{}) } if len(src) != 8 { @@ -231,7 +232,8 @@ func (scanPlanTextAnyToTimeScanner) Scan(src []byte, dst any) error { scanner := (dst).(pgtype.TimeScanner) if src == nil { - return scanner.ScanTime(pgtype.Time{}) + return scanner.ScanTime(pgtype.Time{Valid: true}) //sanek + //return scanner.ScanTime(pgtype.Time{}) } s := string(src) diff --git a/postgres_pgtype/timestamp.go b/postgres_pgtype/timestamp.go index 3c43dd1b..d9cd9de3 100644 --- a/postgres_pgtype/timestamp.go +++ b/postgres_pgtype/timestamp.go @@ -289,7 +289,8 @@ func (plan *scanPlanTextTimestampToTimestampScanner) Scan(src []byte, dst any) e scanner := (dst).(pgtype.TimestampScanner) if src == nil { - return scanner.ScanTimestamp(pgtype.Timestamp{}) + return scanner.ScanTimestamp(pgtype.Timestamp{Valid: true}) //sanek + //return scanner.ScanTimestamp(pgtype.Timestamp{}) } var ts pgtype.Timestamp diff --git a/postgres_pgtype/timestamptz.go b/postgres_pgtype/timestamptz.go index 678402d9..f4051aa6 100644 --- a/postgres_pgtype/timestamptz.go +++ b/postgres_pgtype/timestamptz.go @@ -289,7 +289,8 @@ func (plan *scanPlanTextTimestamptzToTimestamptzScanner) Scan(src []byte, dst an scanner := (dst).(pgtype.TimestamptzScanner) if src == nil { - return scanner.ScanTimestamptz(pgtype.Timestamptz{}) + return scanner.ScanTimestamptz(pgtype.Timestamptz{Valid: true}) //sanek + //return scanner.ScanTimestamptz(pgtype.Timestamptz{}) } var tstz pgtype.Timestamptz