In psql, if one types ‘select * from user’ you’ll get something like the following back:
current_user
--------------
postgres
What is user in this context?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In this context,
useris a reserved internal Postgres function that represents the current user logged in to the database.This query can also be written as:
SELECT user;Which should yield the same thing. Note, if you want to actually reference or create a table named
useryou’ll have to use quotes, or fully qualify the schema it lives in. For example:will work but:
Will yield an error.
Here’s a reference for other system information functions:
http://www.postgresql.org/docs/9.0/static/functions-info.html