Re: [SQL] change username - Mailing list pgsql-sql

From jwieck@debis.com (Jan Wieck)
Subject Re: [SQL] change username
Date
Msg-id m0zuj8x-000EBPC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to change username  (Bill Brandt <brandtwr-pgsql@draaw.net>)
List pgsql-sql
>
> I have a user on my system whose username has recently changed.  The user
> owns and is a non-owning user of multiple database.  I have tried a command
> of the form:
>
> update pg_user set usename='newname' where usesysid=###;
>
> When I try this I get an error.  Does anyone know how to change this
> information?  If I delete the user and recreate the user with the same uid
> does that retain all the existing database permissions?

    pg_user is a system view. Update pg_shadow instead.

    But what error do you get? The command should respond with
    "UPDATE 0" and do nothing!


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-sql by date:

Previous
From: Larry Bottorff
Date:
Subject: Postgres and Stored Procedures
Next
From: Eric McKeown
Date:
Subject: Re: [SQL] booleans