Thread

  1. Move from MySQL to PostgreSQL

    basti <mailinglist@unix-solution.de> — 2023-03-29T12:57:13Z

    Hello, I try to move from MySQL to PostgreSQL.
    
    All seems to work expect of one query.
    The query is part of https://github.com/volkszaehler/volkszaehler.org
    
    https://github.com/volkszaehler/volkszaehler.org/blob/master/lib/Util/Aggregation.php
    
    There are several problems.
    
    One of that ist the 'REPLACE INTO'.
    An other problem is '@prev_timestamp := timestamp'
    
    I have no idea how this can rewritten, so that MySQL and PostgreSQL can 
    understood that.
    For DATE_FORMAT and UNIX_TIMESTAMP I have found wrapper functions.
    
    
    
    Can someone please help me?
    
    Best Regards,
    Basti
    
    
    
    
  2. Re: Move from MySQL to PostgreSQL

    shammat@gmx.net — 2023-03-29T13:34:29Z

    basti schrieb am 29.03.2023 um 14:57:
    > https://github.com/volkszaehler/volkszaehler.org/blob/master/lib/Util/Aggregation.php
    >
    > There are several problems.
    >
    > One of that ist the 'REPLACE INTO'.
    
    Most probably INSERT ... ON CONFLICT
    
    > An other problem is '@prev_timestamp := timestamp'
    
    That's typically done with the lag() window function. No need for query variables.