Skip site navigation (1) Skip section navigation (2)

Client Messages

From: Jim Mlodgenski <jimmy76(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Client Messages
Date: 2012-01-05 16:38:21
Message-ID: CAB_5SRdN1_rx0vkoZ8tC9PmcXCiy0QFEs_=vscg-UrFHeJdB=w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
I have a need to send banner messages to a psql client that I can set
on the server and will be displayed on any psql client that connects
to the database. This would be mostly used as an additional indicator
to which database you are connecting, but could also be used by people
to force their users to see an security message when connecting to the
database. The attached patch will allow you to execute

ALTER DATABASE postgres SET
client_message=E'********************************************************************************\nBEWARE:
You are connecting to a production database. If you do anything to\n
     bring this server down, you will be destroyed by your supreme
overlord.\n********************************************************************************\n';

And then when you connect to psql, you will see:

[e3(at)workstation bin]$ ./psql -U user1 postgres
psql (9.2devel)
********************************************************************************
BEWARE: You are connecting to a production database. If you do anything to
        bring this server down, you will be destroyed by your supreme overlord.
********************************************************************************

Type "help" for help.

postgres=>


Any feedback is welcome.

Thanks

Attachment: client_message.patch
Description: text/x-patch (3.5 KB)

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2012-01-05 16:41:59
Subject: Re: Client Messages
Previous:From: Kevin GrittnerDate: 2012-01-05 16:35:29
Subject: Re: CLOG contention

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group