pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: deepenpatel.lintel@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14550: Select statement and function gives different value for same query.
Date: Fri, 17 Feb 2017 09:29:43 +0000
Message-ID: <20170217092943.6098.33327@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14550
Logged by:          Deepen Patel
Email address:      deepenpatel.lintel@gmail.com
PostgreSQL version: 9.2.18
Operating system:   CentOS 7
Description:        

Hi,

I have write below query in my function which execute on trigger on
insert.

SELECT report_date INTO logdate FROM agent_statistics WHERE agentid =
NEW.caller_id_name
                AND report_date = DATE(NEW.start_stamp);
            SELECT COUNT(*) INTO outbound FROM cdr WHERE (caller_id_name =
NEW.caller_id_name
                AND direction = 'outbound' AND DATE(NEW.start_stamp) =
logdate);
            SELECT COUNT(*) INTO consult FROM cdr WHERE (caller_id_name =
NEW.caller_id_name
                AND direction = 'outbound' AND DATE(NEW.start_stamp) =
logdate AND billsec > '0');

------
outbound and consult value does not gives proper values. but, same query by
select statment gives proper value.

I don't understand how's this possible.

please, any one guide to solve this.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Message-ID: <20170217092943.6098.33327@wrigleys.postgresql.org>
Permalink:  ../20170217092943.6098.33327@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170217092943.6098.33327@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: deepenpatel.lintel@gmail.com
  Subject: Re: BUG #14550: Select statement and function gives different value for same query.
  In-Reply-To: <20170217092943.6098.33327@wrigleys.postgresql.org>
  References: <20170217092943.6098.33327@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox