"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-20.0.2/core/src/cats/dml/0034_select_recent_version_with_basejob.postgresql" (10 Jun 2021, 982 Bytes) of package /linux/misc/bareos-Release-20.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 SELECT DISTINCT ON (Name,
    2                     PathId) JobTDate,
    3                    JobId,
    4                    FileId,
    5                    FileIndex,
    6                    PathId,
    7                    FileName AS Name,
    8                    LStat,
    9                    MD5,
   10                    DeltaSeq,
   11                    Fhinfo,
   12                    Fhnode
   13 FROM
   14   (SELECT FileId,
   15           JobId,
   16           PathId,
   17           Name AS FileName,
   18           FileIndex,
   19           LStat,
   20           MD5,
   21           DeltaSeq,
   22           Fhinfo,
   23           Fhnode
   24    FROM File
   25    WHERE JobId IN (%s)
   26      UNION ALL
   27      SELECT File.FileId,
   28             File.JobId,
   29             PathId,
   30             File.Name AS FileName,
   31             File.FileIndex,
   32             LStat,
   33             MD5,
   34             DeltaSeq,
   35             Fhinfo,
   36             Fhnode
   37      FROM BaseFiles
   38      JOIN File USING (FileId) WHERE BaseFiles.JobId IN (%s) ) AS T
   39 JOIN Job USING (JobId)
   40 ORDER BY Name,
   41          PathId,
   42          JobTDate DESC