Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phVMk-0007wm-Q2 for pgsql-general@arkaria.postgresql.org; Wed, 29 Mar 2023 12:57:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1phVMj-0005uh-P3 for pgsql-general@arkaria.postgresql.org; Wed, 29 Mar 2023 12:57:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phVMj-0005uY-Cd for pgsql-general@lists.postgresql.org; Wed, 29 Mar 2023 12:57:25 +0000 Received: from ikarus.unix-solution.de ([2a00:17d8:100:2::53f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phVMg-0004GY-9A for pgsql-general@postgresql.org; Wed, 29 Mar 2023 12:57:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unix-solution.de; s=mx; h=Content-Transfer-Encoding:Content-Type:Subject: From:To:MIME-Version:Date:Message-ID:Cc:Content-Description:Content-ID: In-Reply-To:References:Resent-Cc:Resent-To; bh=J+41A9TsbnT0FdW+5P4W7KKx95undVEt5ki1yj96jEc=; b=sawoUbZxY8Mz9ErHWo6g9ArDpn ORGtwr8ed2kCGAv4BRwsfXomngpAYJ54/T2+xtgTTQPMcpW1ZiyKJnvcvPdSuPaYRqqiEEFTq2y3k 18Dxc6H17kEYUIcyYMrB43CaA2YPrcVM2Zlx3bhu3VxdPD8JDAu29lDeIKaRn1maZPK4=; Received: from [2a00:1f:4740:6efc:943d:daff:fe2f:dfd] by ikarus.unix-solution.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1phVMd-009nrG-NB for pgsql-general@postgresql.org; Wed, 29 Mar 2023 14:57:19 +0200 Message-ID: Date: Wed, 29 Mar 2023 14:57:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: de-DE, en-US To: "pgsql-general@postgresql.org" From: basti Subject: Move from MySQL to PostgreSQL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ACL-Warn: Max 0 failed recipients allowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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