Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

CURRENT_USER

Name

CURRENT_USER -- Returns the current database username.

Synopsis

    CURRENT_USER

Parameters

This function does not accept parameters.

Results

This function returns the name of the current database user.

Description

Use the CURRENT_USER function to retrieve the name of the current user in a string of type name (a 31 character length non-standard type used for storing system identifiers).

Examples

The following example displays the current user logged into testdb:

testdb=# SELECT CURRENT_USER AS myself;
 myself
--------
 jlx
(1 row)

 
 
  Published courtesy of O'Reilly Design by Interspire