psql   511

« earlier    

Welcome to PyGreSQL — PyGreSQL 5.0 documentation
PyGreSQL is an open-source Python module that interfaces to a PostgreSQL database. It embeds the PostgreSQL query library to allow easy use of the powerful PostgreSQL features from a Python script.
python  pygresql  postgresql  psql 
14 days ago by atog
PostgreSQL: Cannot change directory to /root - Database Administrators Stack Exchange
Try this: [Re: could not change directory to "/root"](http://www.postgresql.org/message-id/12720.1280260751@sss.pgh.pa.us):

Apparently you did "su postgres" from the root account, so you're still in root's home directory. It'd be better to do "su - postgres" to ensure you've acquired all of the postgres account's environment. Reading "man su" might help you out here.
---
Alternative with sudo: sudo -Hiu postgres
https://web.archive.org/web/20170731000608/https://dba.stackexchange.com/questions/40335/postgresql-cannot-change-directory-to-root
https://archive.is/4Gzf

-H
The -H (HOME) option requests that the security policy set the HOME environment variable to the home directory of the target user (root by default) as specified by the password database. Depending on the policy, this may be the default behavior.

-i [command]
The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell. This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. The security policy shall initialize the environment to a minimal set of variables, similar to what is present when a user logs in. The Command Environment section in the sudoers(5) manual documents how the -i option affects the environment in which a command is run when the sudoers policy is in use.

-u user
The -u (user) option causes sudo to run the specified command as a user other than root. To specify a uid instead of a user name, use #uid. When running commands as a uid, many shells require that the '#' be escaped with a backslash ('\'). Security policies may restrict uids to those listed in the password database. The sudoers policy allows uids that are not in the password database as long as the targetpw option is not set. Other security policies may not support this.
StackExchange  PostgreSQL  permissions  sudo  su  psql 
7 weeks ago by coffeebucket
Re: How to list current user and database in PSQL
ksysdb=# select current_user;
current_user
--------------
djuser
psql  howto 
10 weeks ago by jluc77

« earlier    

related tags

(popular  --password  1707  api  app  authentication  backup  bash  bashrc  basic  bestpractice  clear  cli  client  cmdtool  command-line  command  config  connect  connection  create  createdb  createuser  csv  customization  database  databases  db  definition  describe  description  dev  disable  docker  documentation  download  education  enable  environment  example  examples  exist  explanation  extension  fail  fails  fatal  fedora  field  find  for  force  format  formatting  foss  found  full  fundraising  get  gis  github  gtd  guide  hack  hate  heroku  histogram  hostname  howto  image  interactive  job-queue  job  json  knowledge  less  line  lisp  list  lock  locking  login  love  mac  macos  macosx  manual  mapping  materialized  mattermost  migration  mmm  mysql  nlp  node.js  node  nodejs  not  nutshell  opensource  optimization  optimize  osx  output  pager  password  passwordless  performance  permissions  persistance  pev  pg  pgadmin  pgsql  plugin  port  postgres  postgresql  process  processlist  productivity  profile  profiler  profiling  programming  prompt  psqlrc  pygresql  python  qgis  query  rails  read2016  redshift  reference  remove  rest  restful  restore  samvera  screen  screencast  scroll  search  sequence  setenv  setup  shell  show  software  soundex  spanish  sql  sqlite  stackexchange  stackoverflow  stdin  su  sudo  table  tables  tech  temporal  test  time  timeout  timestamps  tips  to  tool  totry  troubleshoot  tuning  tutorial  user  variable  variables  version  vi  view  vim  windows 

Copy this bookmark:



description:


tags: