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 1oAz0m-0007to-AA for pgsql-general@arkaria.postgresql.org; Mon, 11 Jul 2022 19:24:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oAz0l-0003ZF-8p for pgsql-general@arkaria.postgresql.org; Mon, 11 Jul 2022 19:24:03 +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 1oArMF-0003ye-Hp for pgsql-general@lists.postgresql.org; Mon, 11 Jul 2022 11:13:43 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oArMC-0006A1-GU for pgsql-general@lists.postgresql.org; Mon, 11 Jul 2022 11:13:42 +0000 Received: by mail-pl1-x62f.google.com with SMTP id q5so4129488plr.11 for ; Mon, 11 Jul 2022 04:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fincuro-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=BHn71QY247uoPsNgNJ5Wc9hOhzlYolcAdqTy63IYsf4=; b=hSONNNwrhk2IpJXg00jrIB0x6x+2+6sNgb/rEJSqYAv8S/++Ntkx7D6Y6lo4yyMXhs H6mE6HN6wb4V1HVjHB2wRGI6pob4kg73L5fjdxoWYhpDBzoxn/szw8EvbMNkyAny6vMR gJMYzUQpEDRukmTmTFe55x1e1XmXy86/G1w2inMX2G27bRQq4NdVz1P6WL9llwmcWglh SHM2DTnvUEVO5d1AVv8Ft31/8qLZLF+XpshKfM8XA5/EUba9+WYVKPaXqggsavYuVzto EAPSGdeZwIvmcP5UYPpVe5XnMOttXhUzeTiHpndzv4KgbrtKQWkgvIDAqHVKzqqzjDbc 8X1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=BHn71QY247uoPsNgNJ5Wc9hOhzlYolcAdqTy63IYsf4=; b=QymrV27vrQT78ZCL8iHBcEePPyHsX4ZY6DwQzxjRkuuGToMX8H5C369apOfPCBvcSX +5HizlM20u9SjrG0ex5O/HeRslBKmR5q3kArKgVp85/HEP1JTW6fvIh18sL/RbKFugA/ h0FTS4WyEUGI1+ZBLWSGKsHr9LTYf/7I5AlXO+USP0IGGvXT6Jpyxpc4Hylx7f7wdnnC roiN/Qvhxg/pEEORHaiCWx46R4EOLnem3k8Rvc9hhFgLwDnEuNYoYDEm80Am6PLKy312 WGsug/bsfTFB1HTCgEJCJBs2NrCP1Le1TWgZzv79b7DIJIHgzvQ0AFsEsS7Xu3udtsHG GWZg== X-Gm-Message-State: AJIora/UJCngQdgkM5ElBvz9IqWMnU8XQv6y9NyXaLwigEes0hBCGt1e mkVhEyntL52+U1w1WQMdhutgVQ== X-Google-Smtp-Source: AGRyM1vzcuGum15kSdkTRvHBzHbR+BeeVHN9wDmzNRsB9aM5i2ALDJZ2jyqmgWHg1lOts7az+77lOA== X-Received: by 2002:a17:902:d4ce:b0:16c:3d9a:e25d with SMTP id o14-20020a170902d4ce00b0016c3d9ae25dmr8557521plg.15.1657538019259; Mon, 11 Jul 2022 04:13:39 -0700 (PDT) Received: from [172.26.200.10] ([49.205.148.166]) by smtp.gmail.com with ESMTPSA id q64-20020a17090a17c600b001f001acc0e2sm5012957pja.41.2022.07.11.04.13.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jul 2022 04:13:38 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------YiPD0OcTEjzUyCI2XKKCvoRV" Message-ID: <627fb755-dc3a-9873-f54e-1e7e72096e2e@fincuro.com> Date: Mon, 11 Jul 2022 16:43:34 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: - operator overloading not giving expected result Content-Language: en-CA To: Ravi Krishna , "pgsql-general@lists.postgresql.org" References: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com> <1535945057.1729527.1657290905981@mail.yahoo.com> From: Rajesh S In-Reply-To: <1535945057.1729527.1657290905981@mail.yahoo.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------YiPD0OcTEjzUyCI2XKKCvoRV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi All, Thank you for your valuable comments and suggestions.  As it was pointed out we are using EDB Postgres and the language was mentioned as 'edbspl'.  We made to work by setting the search_path variable as follows: set search_path="$user", public, pg_catalog And also changed the Operator overloading function as below. This gave us the expected results.  Thanks once again for all your comments.  Consider this thread as closed. CREATE OR REPLACE FUNCTION public.dt_minus_dt(dt1 DATE, dt2 DATE) RETURNS INTEGER as $$     SELECT (to_char(dt1::date,'J'::varchar) - to_char(dt2::date,'J'::varchar))::integer $$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE COST 1; CREATE OPERATOR public.- (   PROCEDURE = dt_minus_dt,   LEFTARG = DATE,   RIGHTARG = DATE ); Thanks, Rajesh S On 08-07-2022 08:05 pm, Ravi Krishna wrote: > LANGUAGE 'edbspl' > > This is the root cause of your issue. > > > You are not using PGSQL, but EDB version of it which is compatible with Oracle PL/SQL. --------------YiPD0OcTEjzUyCI2XKKCvoRV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi All,

Thank you for your valuable comments and suggestions.=C2=A0 As it = was pointed out we are using EDB Postgres and the language was mentioned as 'edbspl'.=C2=A0 We made to work by setting the search_= path variable as follows:

set search_path=3D"$user", public, pg_catalog

And also changed the Operator overloading function as below.=C2=A0= This gave us the expected results.=C2=A0 Thanks once again for all = your comments.=C2=A0 Consider this thread as closed.

CREATE OR REPLACE FUNCTION public.dt_minus_dt(dt1 DATE, dt2 DATE)<= br> RETURNS INTEGER as
$$
=C2=A0=C2=A0=C2=A0 SELECT (to_char(dt1::date,'J'::varchar) - to_char(dt2::date,'J'::varchar))::integer
$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE COST 1;

CREATE OPERATOR public.- (
=C2=A0 PROCEDURE =3D dt_minus_dt,
=C2=A0 LEFTARG =3D DATE,
=C2=A0 RIGHTARG =3D DATE
);


Thanks,

Rajesh S

=C2=A0

On 08-07-2022 08:05 pm, Ravi Krishna wrote:
LANGUAGE 'edbspl'

This is the root cause of your issue.


You are not using PGSQL, but EDB version of it which is compatible with O=
racle PL/SQL.
--------------YiPD0OcTEjzUyCI2XKKCvoRV--