Conquest and Postgresql 8.3

  • This is for anyone wanting to use postgersql with conquest. After setting up a new installation with Ubuntu Hardy and intending to use postgresql as the database I came accross the following problem. The most recent postgresql available (8.3) has a number of default behaviour changes that includes casting of non-character types.


    Adding images to conquest now produces the message:
    ***Filter: Unable to query for image record
    and the postgresql log has the message:
    2008-07-16 09:55:05 EST ERROR: operator does not exist: character >= integer at character 107
    2008-07-16 09:55:05 EST HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
    2008-07-16 09:55:05 EST STATEMENT: SELECT DICOMImages.ObjectFile FROM DICOMImages, DICOMSeries, DICOMStudies, DICOMPatients WHERE (StudyDate >= 20080623) and DICOMImages.SopInstanc = '1.2.840.113704.1.111.2192.1208497733.2553' and DICOMStudies.PatientID = DICOMPatients.PatientID and DICOMImages.SeriesInst = DICOMSeries.SeriesInst and DICOMSeries.StudyInsta = DICOMStudies.StudyInsta AND DICOMImages.ImagePat = '1042021'


    The release notes for 8.3 inludes the following section


    So in this case StudyDate needs to be explicitly cast as an integer, and I suspect there are many other places where it will fail.
    My old installation using postgresql 8.1 is still working OK.

  • Mark,


    I cannot confirm this behavior. What version and exactly what query where you using? This is what I see for a daterange query:


    Code
    [MICROPLUS] 0008,0020 10 DA StudyDate "20080101- "
    ..
    [MICROPLUS] Query Distinct Tables: DICOMStudies
    [MICROPLUS] Columns : DICOMStudies.StudyDate, DICOMStudies.PatientNam, DICOMStudies.PatientID
    [MICROPLUS] Where : DICOMStudies.StudyDate >= '20080101'


    I believe that your problem may be in a ExportFilter, i.e., it is a problem with a query given in dicom.ini and not a problem with the server source.


    Marcel

  • Thanks Marcel,
    I have an export filter in the form
    ExportFilter0 = StudyDate >= 20080815
    where a script updates the date every day which was OK up until postgres 8.3.
    I tried this setup on another machine and could not reproduce the problem, and have since changed to mysql on my production machine so I'll have to investigate further.


    One thing I did notice was that if the setting in postgresql.conf of standard_conforming_strings is set to off you get the following types of warnings from conquest
    WARNING: nonstandard use of \\ in a string literal
    LINE 1: ...3234.00', '1', 'MONOCHROME2', '128', '128', '16', 'DERIVED\\...
    HINT: Use the escape string syntax for backslashes, e.g., E'\\'.


    If you set standard_conforming_strings to on which the release notes say will be standard in the future, then the warning goes away but modality strings like NM\CT are not handled correctly until the DoubleBackSlashToDB is changed to 0.

  • Hi,


    I guess that explains, it should become:


    ExportFilter0 = StudyDate >= '20080815'


    So you are also saying that for versions of PostGres beyond 8.3 DoubleBackSlashToDB should be set to 0? Or should there be a third setting for DoubleBackSlashToDB?


    Regards,


    Marcel



  • Will you share the script you use to update the ExportFilter?


    Wes

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!