Doctrine 1
  1. Doctrine 1
  2. DC-331

Wrong SQL output from Doctrine_Expression for pgsql with timestamp with time zone field

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0-RC1
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      This is with Symfony 1.3 alpha (which is pretty good) Can't tell you which Doctrine it comes with

      Description

      (1) pgsql connection
      (2) timestamp with time zone column
      (3) $doctrine_expression = new Doctrine_Expression('NOW()');
      echo $doctrine_expression->getSQL();
      gives:
      LOCALTIMESTAMP(0)

      What I'd like to get access to using that Doctrine construct is the
      functionality of 'CURRENT_TIMESTAMP', (has time zone,
      stores time in TIMESTAMP WITH TIME ZONE columns in UTC time)

      Fortunately, all the databases that I want to use implement
      'CURRENT_TIMESTAMP', but not all PDO/Doctrine databases
      support that construct, even though it's ANSI SQL standard,
      (which ANSI I don't know.)

        Activity

        Hide
        Michael Pearson added a comment -

        I'm also seeing this with Symfony 1.4.1 (w/Doctrine 1.2). Affects timestampable tables (created_at, updated_at).

        also, NOW() AT TIME ZONE 'UTC' translates to LOCALTIMESTAMP(0) AT TIME ZONE 'UTC' (via buildSqlQuery).

        Show
        Michael Pearson added a comment - I'm also seeing this with Symfony 1.4.1 (w/Doctrine 1.2). Affects timestampable tables (created_at, updated_at). also, NOW() AT TIME ZONE 'UTC' translates to LOCALTIMESTAMP(0) AT TIME ZONE 'UTC' (via buildSqlQuery).

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Dennis Gearon
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: