Error in creating the backend query - Mailing list pgsql-admin

From Benjamin Krajmalnik
Subject Error in creating the backend query
Date
Msg-id F4E6A2751A2823418A21D4A160B689883FCC6A@fletch.stackdump.local
Whole thread Raw
Responses Re: Error in creating the backend query
List pgsql-admin

PostgreSQL 8.3.7 running on FreeBSD.

 

The following query:

 

               update tblksalerts

                  set cleartime =  x_cleartime,

                      laststatusid = x_statusid,

                      lastreplytext = x_replytxt,

                      lasttesttime =  x_testtime,

                      lasteventsource = x_eventsource,

                      lasteventid = x_eventid,

                      replyval = x_replyval,

                      trend = mytrend,

                      alertoccurrence = testcount

                where ksalertssysid = alertsrecord.ksalertssysid;

 

being issued via a pl/pgsql stored procedure is being translated by the backend as follows:

 

update tblksalerts set cleartime = '2009-07-29 10:49:50'::TIMESTAMP, laststatusid = 7::INTEGER, lastreplytext = '0'::VARCHAR, lasttesttime = '2009-07-29 10:49:50'::TIMESTAMP, lasteventsource is NULL::VARCHAR, lasteventid is NULL::INTEGER, replyval = 0::REAL, trend = ''::varchar ( 1 ), alertoccurrence = 0::integer where ksalertssysid = 1737078

 

and is generating a syntax error:  syntax error at or near "is" at character 192

 

Please note the “lasteventsource is null” instead of “lasteventsource = null” which is being generated when the value of x_eventsource is null.

We have implemented a workaround by setting the value to a blank string, but I believe this is a problem nonetheless.

 

pgsql-admin by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Off-topic - Hardware recommendation
Next
From: Michael Monnerie
Date:
Subject: Re: Off-topic - Hardware recommendation