Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12893

Unable to sort by a date field at PostgreSQL - CAST() problem

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.3, 1.9
    • 1.8.6, 1.9.1
    • None
    • Reported at PostgreSQL 8.0
    • PostgreSQL
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      See mod/data/field/date/field.class.php :

      function get_sort_sql($fieldname) {
      return 'CAST('.$fieldname.' AS unsigned)';
      }

      This causes problem at PostgreSQL as there is no such type "unsigned": ERROR: type "unsigned" does not exist. Note that CAST() is SQL standard but the target datatype has to be known for the SQL environement.

      No records are displayed.

      Assigning this to myself as a part of my Bugathon run.

      Attachments

        Activity

          People

            stronk7 Eloy Lafuente (stronk7)
            mudrd8mz David Mudrák (@mudrd8mz)
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Raquel Ortega, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/May/08