문제

I'm trying to develop a script to SET application_name log feature in PHP application.

pg_query("SET application_name = 'Test log line'");

What I tried it above code. But it give following error,

Warning: pg_query(): Query failed: ERROR: unrecognized configuration parameter "application_name" in ...

This means I can't simply execute SET application_name query from pg_query() function.

Can anyone help me to find a way to set this from a PHP script.

Thank you!

도움이 되었습니까?

해결책

You're on an old PostgreSQL version.

application_name was introduced in 9.0. Compare to the 8.4 documentation with the link at the top.

You need to upgrade or skip using the feature.

In general, if you get errors that indicate that PostgreSQL has no idea what you're talking about - functions not found, views missing, syntax errors on what looks like the documented syntax, etc - then you should be thinking "am I reading the manual for my version".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top