Pergunta

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!

Foi útil?

Solução

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".

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top