Search Postgresql Archives

Re: How to access tables using a superuser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

I logged into the same database. I can say the commands, and you can correct me if I'm wrong.

Ordinary User: psql -h localhost -d db -U ordinaryusername
Select * from contacts
Now, I can access the tables. I also do have the .SQL file where it states the table schema as follows:
CREATE USER sa;
GRANT ALL ON DATABASE db TO sa;
\c db sa
CREATE SCHEMA AUTHORIZATION sa;
ALTER USER sa SET search_path TO sa,public;
CREATE TABLE sa.contacts (
        contact_id      SERIAL PRIMARY KEY,
        contact_type    INTEGER DEFAULT 0,
        display_name    TEXT NOT NULL DEFAULT '',
        UNIQUE(display_name)
    ) WITHOUT OIDS;

I logged into the database as a super-user: psql -h localhost -d db -U postgres
Select * from contacts;
ERROR: relation "contacts" does not exist.

Could you please guide me on this part? I wish to access the table using the super-user.

Thanks and Regards,
Siva.


-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of John R Pierce
Sent: Thursday, August 18, 2011 12:40 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: Re:  How to access tables using a superuser

On 08/17/11 11:58 PM, Siva Palanisamy wrote:
>
> Hi All,
>
> I have few tables being created using an ordinary user account. When I
> login into the postgresql using the super-user, I can't access my tables!
>
> It says, ERROR: relation "tablename" does not exist.
>
> As I need to perform some operations using super-user, I want the
> tables to be accessed/mapped to the super-user account. Any clue on
> this part?
>
>


are you logged into the same database ? are these tables in a schema
other than public?


--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux