From: | Siva Palanisamy <siva_p(at)hcl(dot)com> |
---|---|
To: | John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to access tables using a superuser |
Date: | 2011-08-18 07:18:19 |
Message-ID: | 90F0F47595235141A4380FCF01B0185B20BC49F4F7@CHN-HCLT-EVS07.HCLT.CORP.HCL.IN |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of John R Pierce
Sent: Thursday, August 18, 2011 12:40 PM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] 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(at)postgresql(dot)org)
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.
-----------------------------------------------------------------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume Lelarge | 2011-08-18 07:48:40 | Re: How to access tables using a superuser |
Previous Message | John R Pierce | 2011-08-18 07:09:45 | Re: How to access tables using a superuser |