Skip to content

Inconsistent datatype of study.created_time and other timestamp-typed fields. #2

@kamikat

Description

@kamikat

Archiver uses local time in its insertion query while the schema uses timestamp data type (whose actual type is timestamp without time zone).

Here's a statement log from postgres:

LOG: execute : insert into study (access_control_id, access_time, accession_no, dicomattrs_fk, completeness, created_time, expiration_date, ext_retrieve_aet, failed_retrieves, accno_issuer_fk, modified_time, patient_fk, ref_phys_name_fk, rejection_state, storage_ids, study_custom1, study_custom2, study_custom3, study_date, study_desc, study_id, study_iuid, study_time, updated_time, version, pk) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26)
DETAIL: parameters: $1 = '', $2 = '2018-04-13 00:07:58.729', $3 = '25130065', $4 = '13204', $5 = '2', $6 = '2018-04-13 00:07:58.729', $7 = NULL, $8 = '', $9 = '0', $10 = NULL, $11 = '2018-04-13 00:07:58.729', $12 = '2898', $13 = NULL, $14 = '0', $15 = 'fs1', $16 = '', $17 = '', $18 = '*', $19 = '20150608', $20 = 'CHEST', $21 = '906', $22 = '1.2.840.20150608.25130065', $23 = '174236.000', $24 = '2018-04-13 00:07:58.729', $25 = '0', $26 = '2898'

Where the timestamp 2018-04-13 00:07:58.729 used by hibernate is in local time but postgres interprets the value of created_time as timestamp without time zone according to the schema:

pacsdb=# select extract(epoch from created_time) from study where pk = '2898';
   date_part
----------------
 1523578078.729
(1 row)

While the expected result for this query is:

pacsdb=# select extract(epoch from created_time :: timestamp with time zone) from study where pk = '2898';
   date_part
----------------
 1523549278.729
(1 row)

Version of images:

dcm4che/dcm4chee-arc-psql:5.10.3-logstash-secure-ui
dcm4che/postgres-dcm4chee:9.6-10
dcm4che/slapd-dcm4chee:2.4.40-10.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions