Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0pN2-00DOU1-VZ for pgsql-sql@arkaria.postgresql.org; Tue, 15 Oct 2024 21:46:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t0pN0-00BtND-Bd for pgsql-sql@arkaria.postgresql.org; Tue, 15 Oct 2024 21:46:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0pN0-00BtN4-2k for pgsql-sql@lists.postgresql.org; Tue, 15 Oct 2024 21:46:22 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t0pMt-0014Jq-Vv for pgsql-sql@lists.postgresql.org; Tue, 15 Oct 2024 21:46:21 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-539e63c8678so3718458e87.0 for ; Tue, 15 Oct 2024 14:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729028774; x=1729633574; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rHsGMzVOXN7inhZaVYwKMOdYlX/Lh7gSvnvRjxvGDfs=; b=nohYiOMpKGhS0yZZhjMlhH2eigUR+BiFYTNVAuuM4e4XzHKBPK4A5am0pEII/MV9u0 nUPvNhwoal8vPTQUfg1iGum1fmOTizzXQaP791dLpVcJITNsIY6ULutIEXxi0rTL9ngW d9ER4klROPUuLzNoJEO6Eqt579IoXB46jlYBFvV4Wp+7slZ0BAf6/b7CEkvAmYuys2L+ hnX7+Ir8rzwRLpp72mV64pKVopqUYVGDuxRRuCceJF8fnFIhi0Oq/YOrHqrWfHxd4AI8 yRLSnV/JYqEiJZHTLmNzg6TudeQYsCvOXfDxRmyhP06SFh8sA1oeAFzr5w8AWInov9fq cZkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729028774; x=1729633574; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rHsGMzVOXN7inhZaVYwKMOdYlX/Lh7gSvnvRjxvGDfs=; b=xMGeivE7yG4jfWo5n4XASdTbJ9jqSItq2qLERZajw8eNfzezhdeL0tQKWhlrz8gPCL I+BeGEvF488+yhmmn2vWGozDxrQ+XLo+8i0DblyzjP0R0UTxz6Rl79ZXi8qB+p3S8hok j5Tjx+TlzbEWIKaivIP3tSTLGriCzuYfHxADb+ohd4JZKgcRw1xmJWfviSzC7bADv2NG 81peDLtLmQZVrb+jJpf1rjtNO0/6pGPhIa545Oys7T/Wnnpj8jv85jHTYWmZKL3SuIW9 JQ8P+7UgmaBes0ZUgB6OE9XughpNOBcKcgOCDzszrP+B4rpj9hYkotag1Amtv9lDYzT9 jRGA== X-Gm-Message-State: AOJu0YxS48NHe5gK9f1kKkog5EWCveNVKpcCvDr4SojRmP5Q60u5Q/FM f0zY75w2qgW58cRX6VF+16Nsn/9NqrpNiZiI8DbQHnX1ckLeczE+OfBaTVe7lKuhlBK5qqwkSJg s9vP+CeYBtBEINrKwT4HpPdGL0/Y= X-Google-Smtp-Source: AGHT+IF0+n6lr/h/qunRdWogHotkIuwanIlGatObg04R+wcajpWzSX0p6ZglRaOIpS1OacM3d/h2PgGE/0cYalxC70M= X-Received: by 2002:a05:6512:e9d:b0:535:6aa9:9855 with SMTP id 2adb3069b0e04-539e54051famr6475288e87.0.1729028774019; Tue, 15 Oct 2024 14:46:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Wed, 16 Oct 2024 10:46:01 +1300 Message-ID: Subject: Re: Oracle ==> Postgres View To: Sam Stearns Cc: pgsql-sql@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 16 Oct 2024 at 10:31, Sam Stearns wrote: > coalesce(CASE WHEN impact_category='BULK_RATE_REQUEST', 1, -- To handle Portal's category for the old RIP > 'CONTRACT_BULK_RATE', 1, > 'SPOT_BULK_RATE', 2, > 'CONTRACT_HISTORY', 3, > 'SPOT_HISTORY', 4, > 'RATE_SUBMISSION', 5, > 'SPOT_BACKHAUL' THEN 6 END , 0), > > Would anyone be able to advise how to correct this for Postgres, please? Have a look at the syntax of your case statement and check it against [1]. David [1] https://www.postgresql.org/docs/current/functions-conditional.html