Re: Getting value of bind variables

Поиск
Список
Период
Сортировка
От Jayadevan M
Тема Re: Getting value of bind variables
Дата
Msg-id OF7BCFF519.81EB64BE-ON652578F5.0012E5EF-652578F5.0013E71F@ibsplc.com
обсуждение исходный текст
Ответ на Re: Getting value of bind variables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Getting value of bind variables  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hi,
Thank you for the reply.
> > I am trying to debug a query that gives an error. The error in the
> > application server log is
> > " ERROR: operator does not exist: timestamp without time zone = character
> > varying
>
> > It looks like the error is for the condition ( CUSINDINF.MEMDOB ) = ($4) ,
> > memdob being a date of birth (timestamp) column. When I try the query at
> > psql with some values, the data is retrieved OK. Is there some logging
> > available in PostgreSQL that will tell me what values were actually used?
>
> Yes, if you're using a reasonably recent version of Postgres ---
> log_statements should provide that information.  However, it's 100%
> irrelevant to this problem what the specific value is.  The problem is
> that the application is declaring the *type* of $4 as varchar rather
> than something appropriate.
>
I guess so. But when I tried the same query on psql by replacing ($4) with a value like '20110404', the query works OK. The value of $4 is being passed from a java application. So does this mean I have to change the data type in java code?


By the way ,even log_statemtnts did not give me the bind variable value. It gave me values for bind variables for queries which got executed, not for this particular query. I am logging to csv file and loading it to the postgres_log as mentioned in the document. For this scenario, does the output go somewhere else? I am looking at the column query_text (select * from postgres_log where error_severity='ERROR' and log_time > '20110818')

and it shows
.....AND   (  CUSINDINF.MEMDOB  )=  ($4)  ....


Regards,
Jayadevan





DISCLAIMER:


"The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."





В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Updating Arrays
Следующее
От: Condor
Дата:
Сообщение: Re: securing the sql server ?