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 1nbf9x-0005T1-MC for pgsql-admin@arkaria.postgresql.org; Tue, 05 Apr 2022 09:07:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbf9w-0006tN-Hy for pgsql-admin@arkaria.postgresql.org; Tue, 05 Apr 2022 09:07:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbf9v-0006tD-VJ for pgsql-admin@lists.postgresql.org; Tue, 05 Apr 2022 09:07:32 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbf9p-0006YH-0j for pgsql-admin@lists.postgresql.org; Tue, 05 Apr 2022 09:07:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lu1n8OUrnEcyNUFlFLjf6C2HkFuXODfQAJVxQZEiy9g=; b=QIuqTb+RxtnBO2NLRTUu5/Qz79 t7QbdkQlRD827HtyT9qfbtYjsHLBHyZioqlgBjM0a9hO6Eighq3eiNJ/0WexHY5x80FKuDT0aiV1f NtgYj6J4hoMpcBldKMWOhrznlXVbjr2IpXHMSzwIWKa5hg74jDcJ7jJ6ISVXtrI83X84=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1nbf9l-00023X-HG; Tue, 05 Apr 2022 11:07:21 +0200 Date: Tue, 5 Apr 2022 11:07:21 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Nikhil Ingale Cc: pgsql-admin@lists.postgresql.org Subject: Re: failed to execute the psql case statement which has the function call. Message-ID: <20220405090721.GA4757@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 05, 2022 at 01:30:14PM +0530, Nikhil Ingale wrote: > Hi All, > > I've a case statement where I'm calling the user defined postgres function > and failed to execute the same. Because it's assuming the variable passed > inside the function as a column for the table. > > ERROR: column "attributes" does not exist > LINE 1: ... WHEN status_code = 0 THEN CASE WHEN bmask(attributes... > > Need help to resolve this problem. Well, we need to see the function. Otherwise all *I* can tell is: well, you have to find source of the problem, and fix it. Best regards, depesz