How to SET postgres application_name in a basic PHP script

Yasiru G

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!

Craig Ringer

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to set application_name for postgres connections?

From Dev

How to setup postgres application_name logging

From Dev

How to set application_name with sinatra/sequel

From Dev

How to set application_name with sinatra/sequel

From Dev

Set application_name during connection

From Dev

Set application_name during connection

From Dev

How to set breakpoints in a php script using gdb

From Dev

PHP basic upload file script

From Dev

How to dynamically set a variable name in shell script?

From Dev

How to find the name of php script that posted the data to another php script?

From Dev

How can I set up a php script to run via cron?

From Dev

Undefined offset Notice in basic PHP script

From Dev

In php: How to set <select name=[php variable name] >?

From Dev

How to set DOCUMENT_ROOT and SCRIPT_NAME correctly for fcgiwrap

From Dev

Basic php - echo mysql, how?

From Java

How to create User/Database in script for Docker Postgres

From Dev

How to stop PHP Script?

From Dev

How to secure a PHP script?

From Dev

How to secure a PHP script?

From Dev

How to stop PHP Script?

From Dev

Postgres: How to get next item in an enum set?

From Dev

How to set class path for jdbc driver for postgres

From Dev

How to run postgres sql script from another script?

From Dev

How to know if a name refers to mysql table or mysql view in a php script

From Dev

How to call a script function with same div name in php?

From Dev

how to change name of uploaded file in php in the script below

From Dev

How to decompose a shape into a set of basic shapes?

From Dev

Visual Basic Form Coding (how to set a directory)

From Dev

How to set word wrap in OO Basic Macro?

Related Related

HotTag

Archive