1

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!

2
  • 1
    Weird looks ok to me. What version of postgres are you using? Commented Apr 8, 2014 at 5:22
  • Client: postgresql-client-8.4 Server: postgresql-8.4 Commented Apr 8, 2014 at 5:39

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Let me check on that :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.