Обсуждение: [BUGS] BUG #14550: Select statement and function gives different value forsame query.

Поиск
Список
Период
Сортировка

[BUGS] BUG #14550: Select statement and function gives different value forsame query.

От
deepenpatel.lintel@gmail.com
Дата:
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