Re: isnumeric() function?

Lists: pgsql-sql
From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: pgsql-sql(at)postgresql(dot)org
Subject: Permissions not working
Date: 2004-04-29 20:53:10
Message-ID: 40916B36.8070802@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hi ,

I am having some problems with setting up permissions in Postgres. I
have a database for ex: 'ups' and it was owned previously by
'postgres(superuser)' but now i have changed the ownership to new user
'ups' all the tables are owned by these user 'ups'. This database doesnt
have any schemas except for 'Public'. I have created another user lets
say 'test' and i didnt give 'test' user any permissions to access the
tables owned by 'ups' but still when i login to 'ups' database as psql
ups test and run a select on the tables owned by 'ups' database it
goes through.
I dont want user 'test' to access any tables from the 'ups'
database, i tried revoking permissions it still doesnt work. Can anyone
tell me what is wrong here ?

Appreciate your help.

Thanks!
Pallav


From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Pallav Kalva <pkalva(at)deg(dot)cc>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Permissions not working
Date: 2004-04-29 21:26:01
Message-ID: Pine.LNX.4.33.0404291522430.10983-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

On Thu, 29 Apr 2004, Pallav Kalva wrote:

> Hi ,
>
> I am having some problems with setting up permissions in Postgres. I
> have a database for ex: 'ups' and it was owned previously by
> 'postgres(superuser)' but now i have changed the ownership to new user
> 'ups' all the tables are owned by these user 'ups'. This database doesnt
> have any schemas except for 'Public'. I have created another user lets
> say 'test' and i didnt give 'test' user any permissions to access the
> tables owned by 'ups' but still when i login to 'ups' database as psql
> ups test and run a select on the tables owned by 'ups' database it
> goes through.
> I dont want user 'test' to access any tables from the 'ups'
> database, i tried revoking permissions it still doesnt work. Can anyone
> tell me what is wrong here ?

Log in as the superuser (usually postgres) and see what you get from this
query:

select usesuper from pg_shadow where usename='test';

if usesuper is t, then test is a superuser and can do anything he wants.
You need to issue the command:

alter user test with nocreateuser;

If that isn't the problem, let us know.


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-04-29 21:45:12
Message-ID: 40917768.8040107@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

scott.marlowe wrote:

>On Thu, 29 Apr 2004, Pallav Kalva wrote:
>
>
>
>>Hi ,
>>
>> I am having some problems with setting up permissions in Postgres. I
>>have a database for ex: 'ups' and it was owned previously by
>>'postgres(superuser)' but now i have changed the ownership to new user
>>'ups' all the tables are owned by these user 'ups'. This database doesnt
>>have any schemas except for 'Public'. I have created another user lets
>>say 'test' and i didnt give 'test' user any permissions to access the
>>tables owned by 'ups' but still when i login to 'ups' database as psql
>>ups test and run a select on the tables owned by 'ups' database it
>>goes through.
>> I dont want user 'test' to access any tables from the 'ups'
>>database, i tried revoking permissions it still doesnt work. Can anyone
>>tell me what is wrong here ?
>>
>>
>
>Log in as the superuser (usually postgres) and see what you get from this
>query:
>
>select usesuper from pg_shadow where usename='test';
>
>if usesuper is t, then test is a superuser and can do anything he wants.
>You need to issue the command:
>
>alter user test with nocreateuser;
>
>If that isn't the problem, let us know.
>
>
Thanks! for the quick reply, I ran the above query and it is 'f' for the
'test' user, 'test' is not a super user.


From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Pallav Kalva <pkalva(at)deg(dot)cc>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Permissions not working
Date: 2004-04-29 21:59:11
Message-ID: Pine.LNX.4.33.0404291558160.11110-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

On Thu, 29 Apr 2004, Pallav Kalva wrote:

> scott.marlowe wrote:
>
> >On Thu, 29 Apr 2004, Pallav Kalva wrote:
> >
> >
> >
> >>Hi ,
> >>
> >> I am having some problems with setting up permissions in Postgres. I
> >>have a database for ex: 'ups' and it was owned previously by
> >>'postgres(superuser)' but now i have changed the ownership to new user
> >>'ups' all the tables are owned by these user 'ups'. This database doesnt
> >>have any schemas except for 'Public'. I have created another user lets
> >>say 'test' and i didnt give 'test' user any permissions to access the
> >>tables owned by 'ups' but still when i login to 'ups' database as psql
> >>ups test and run a select on the tables owned by 'ups' database it
> >>goes through.
> >> I dont want user 'test' to access any tables from the 'ups'
> >>database, i tried revoking permissions it still doesnt work. Can anyone
> >>tell me what is wrong here ?
> >>
> >>
> >
> >Log in as the superuser (usually postgres) and see what you get from this
> >query:
> >
> >select usesuper from pg_shadow where usename='test';
> >
> >if usesuper is t, then test is a superuser and can do anything he wants.
> >You need to issue the command:
> >
> >alter user test with nocreateuser;
> >
> >If that isn't the problem, let us know.
> >
> >
> Thanks! for the quick reply, I ran the above query and it is 'f' for the
> 'test' user, 'test' is not a super user.

Ok, then what does

\z tablename

where tablename is one of the tables you don't want test to access.


From: "Yudie" <yudie(at)axiontech(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: isnumeric() function?
Date: 2004-04-29 22:46:21
Message-ID: 000c01c42e3b$cc18c4e0$8401a8c0@home.axiontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

What is isnumeric function in postgresql?
I'm using psql version 7.2.2
thanks
Yudie


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pallav Kalva <pkalva(at)deg(dot)cc>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-04-29 23:07:27
Message-ID: 17807.1083280047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Pallav Kalva <pkalva(at)deg(dot)cc> writes:
> I have a database for ex: 'ups' and it was owned previously by
> 'postgres(superuser)' but now i have changed the ownership to new user
> 'ups' all the tables are owned by these user 'ups'.

That isn't a supported operation. How did you do it exactly? I suspect
that you got it wrong somehow ...

> I dont want user 'test' to access any tables from the 'ups'
> database, i tried revoking permissions it still doesnt work.

What did you revoke? What does psql's "\z" command show for the problem
tables?

regards, tom lane


From: CoL <col(at)mportal(dot)hu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: isnumeric() function?
Date: 2004-04-30 07:14:32
Message-ID: c6sucs$gga$2@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

hi,

Yudie wrote:

> What is isnumeric function in postgresql?
> I'm using psql version 7.2.2
> thanks

probably somebody write a function called isnumeric for you :) So it
must be a user defined function.

C.


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-04-30 13:37:25
Message-ID: 40925695.8060908@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Tom Lane wrote:

>Pallav Kalva <pkalva(at)deg(dot)cc> writes:
>
>
>>I have a database for ex: 'ups' and it was owned previously by
>>'postgres(superuser)' but now i have changed the ownership to new user
>>'ups' all the tables are owned by these user 'ups'.
>>
>>
>
>That isn't a supported operation. How did you do it exactly? I suspect
>that you got it wrong somehow ...
>

Sorry, I wasnt clear on this. First I created a database called 'ups'
and made user 'ups' as its owner. Then
I dumped the database from backup, the dumped database backup was
owned by 'postgres ' user but all the
tables in this database are owned by 'ups' user.

>
>
>
>>I dont want user 'test' to access any tables from the 'ups'
>>database, i tried revoking permissions it still doesnt work.
>>
>>
>
>What did you revoke? What does psql's "\z" command show for the problem
>tables?
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
>
Here is the output from the \z . I tried to revoke all the privileges
from the PUBLIC and user 'test'.

usps=> \z citystate_alias
Access privileges
for database "usps"
Schema | Table
| Access privileges
--------+-----------------+-----------------------------------------------------------------------------------------------------------------------
public | citystate_alias |
{postgres=a*r*w*d*R*x*t*/postgres,=r/postgres,usps=arwdRxt/postgres,"group
100=r/usps","group ea_development=r/usps"}
(1 row)


From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Yudie <yudie(at)axiontech(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: isnumeric() function?
Date: 2004-04-30 14:11:45
Message-ID: 20040430141145.40776.qmail@web20809.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

--- Yudie <yudie(at)axiontech(dot)com> wrote:
> What is isnumeric function in postgresql?
> I'm using psql version 7.2.2
> thanks
> Yudie

I don't think that function is included as such. But
you could do something like:

CREATE FUNCTION isnumeric(text) RETURNS boolean AS '
SELECT $1 ~ ''^[0-9]+$''
' LANGUAGE 'sql';

Note that you would need to create this function for
every parameter datatype that you would intend to use,
or else be prepared to cast your input datatype as
appropriate.

>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
majordomo(at)postgresql(dot)org)



__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover


From: "Yudie" <yudie(at)axiontech(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: isnumeric() function?
Date: 2004-04-30 15:29:16
Message-ID: 003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Great the function works, but what does it means?
SELECT $1 ~ ''^[0-9]+$''

Yudie

----- Original Message -----
From: "Jeff Eckermann" <jeff_eckermann(at)yahoo(dot)com>
To: "Yudie" <yudie(at)axiontech(dot)com>; <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, April 30, 2004 9:11 AM
Subject: Re: [SQL] isnumeric() function?

--- Yudie <yudie(at)axiontech(dot)com> wrote:
> What is isnumeric function in postgresql?
> I'm using psql version 7.2.2
> thanks
> Yudie

I don't think that function is included as such. But
you could do something like:

CREATE FUNCTION isnumeric(text) RETURNS boolean AS '
SELECT $1 ~ ''^[0-9]+$''
' LANGUAGE 'sql';

Note that you would need to create this function for
every parameter datatype that you would intend to use,
or else be prepared to cast your input datatype as
appropriate.

>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
majordomo(at)postgresql(dot)org)

__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pallav Kalva <pkalva(at)deg(dot)cc>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-04-30 16:19:39
Message-ID: 26201.1083341979@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Pallav Kalva <pkalva(at)deg(dot)cc> writes:
> usps=> \z citystate_alias
> Access privileges
> for database "usps"
> Schema | Table
> | Access privileges
> --------+-----------------+-----------------------------------------------------------------------------------------------------------------------
> public | citystate_alias |
> {postgres=a*r*w*d*R*x*t*/postgres,=r/postgres,usps=arwdRxt/postgres,"group
> 100=r/usps","group ea_development=r/usps"}
> (1 row)

It looks to me like (a) this table is owned by postgres not usps, and
(b) postgres has granted SELECT permission to PUBLIC (that's what the
"=r/postgres" part means). The usps user isn't going to be able to
revoke that because he doesn't own the table.

It does seem like you've found a bug of some kind though: the above
shows that user usps does not have GRANT OPTION rights of any kind
(there are no stars in his privilege list). So how was he able to grant
SELECT rights to those two groups? Do you have the exact sequence of
GRANT and REVOKE operations that were performed on this table? What
PG version is this, exactly?

regards, tom lane


From: Frank Bax <fbax(at)sympatico(dot)ca>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: isnumeric() function?
Date: 2004-04-30 16:24:03
Message-ID: 5.2.1.1.0.20040430121848.02a4cda0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

At 11:29 AM 4/30/04, Yudie wrote:
>Great the function works, but what does it means?
>SELECT $1 ~ ''^[0-9]+$''
>
>Yudie

The ~ is a pattern matching operator.
^ matches beginning of string
[0-9] matches any numeric digit 0 thru 9.
+ matches one or more occurrences of what came before (digits in
this case)
$ matches end of string
The ^ and $ are important - if they were left out, the pattern would match
a string containing both numeric and non-numeric data.

You can change the + to * if you decide that an empty string should be
considered numeric.

Frank


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-04-30 18:00:51
Message-ID: 40929453.10501@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Tom Lane wrote:

>Pallav Kalva <pkalva(at)deg(dot)cc> writes:
>
>
>>usps=> \z citystate_alias
>> Access privileges
>>for database "usps"
>> Schema | Table
>>| Access privileges
>>--------+-----------------+-----------------------------------------------------------------------------------------------------------------------
>> public | citystate_alias |
>>{postgres=a*r*w*d*R*x*t*/postgres,=r/postgres,usps=arwdRxt/postgres,"group
>>100=r/usps","group ea_development=r/usps"}
>>(1 row)
>>
>>
>
>It looks to me like (a) this table is owned by postgres not usps, and
>(b) postgres has granted SELECT permission to PUBLIC (that's what the
>"=r/postgres" part means). The usps user isn't going to be able to
>revoke that because he doesn't own the table.
>
>It does seem like you've found a bug of some kind though: the above
>shows that user usps does not have GRANT OPTION rights of any kind
>(there are no stars in his privilege list). So how was he able to grant
>SELECT rights to those two groups? Do you have the exact sequence of
>GRANT and REVOKE operations that were performed on this table? What
>PG version is this, exactly?
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
>
>
I am using Postgres 7.4.2 version. I dont have exact sequence of GRANT
and REVOKE
commands. and as i told earlier I created the database first and then
dumped it from the backups.
The table infact is owned by 'usps' user here is the output from \dt for
that table

usps=> \dt
List of relations
Schema | Name | Type | Owner
--------+------------------+-------+-------
public | citystate_alias | table | usps

Also here is the privileges information from information_schema tables.
Is there a way to REVOKE these
privileges ?

usps=> select * from information_schema.table_privileges where
table_name = 'citystate_alias';
grantor | grantee | table_catalog | table_schema |
table_name | privilege_type | is_grantable | with_hierarchy
----------+----------------+---------------+--------------+-----------------+----------------+--------------+----------------
postgres | usps | usps | public |
citystate_alias | SELECT | NO | NO
postgres | PUBLIC | usps | public |
citystate_alias | SELECT | NO | NO
usps | ea_development | usps | public |
citystate_alias | SELECT | NO | NO
postgres | usps | usps | public |
citystate_alias | DELETE | NO | NO
postgres | usps | usps | public |
citystate_alias | INSERT | NO | NO
postgres | usps | usps | public |
citystate_alias | UPDATE | NO | NO
postgres | usps | usps | public |
citystate_alias | REFERENCES | NO | NO
postgres | usps | usps | public |
citystate_alias | RULE | NO | NO
postgres | usps | usps | public |
citystate_alias | TRIGGER | NO | NO
(9 rows)


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pallav Kalva <pkalva(at)deg(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Permissions not working
Date: 2004-05-01 21:13:45
Message-ID: 200405012313.45607.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Pallav Kalva wrote:
> Also here is the privileges information from information_schema
> tables. Is there a way to REVOKE these
> privileges ?

You need to log in as the user that has granted the privilege you want
to revoke. In this case, log in as postgres and do REVOKE ALL FROM
PUBLIC;.


From: "Eric Anderson Vianet SAO" <eric(at)vianet-express(dot)com(dot)br>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: \D TO FILE
Date: 2004-05-03 11:49:03
Message-ID: 00b501c43104$a1fdede0$0701a8c0@netterm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

How could I record the ´ \d table ´ command to a file?

sds

Eric Anderson
CPD Via Net SAO
11-66432800


From: Geoffrey <esoteric(at)3times25(dot)net>
To: Eric Anderson Vianet SAO <eric(at)vianet-express(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: \D TO FILE
Date: 2004-05-03 12:32:40
Message-ID: 40963BE8.4020007@3times25.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Eric Anderson Vianet SAO wrote:
> How could I record the ´ \d table ´ command to a file?

echo '\d' | psql rnd > outputfile

--
Until later, Geoffrey Registered Linux User #108567
Building secure systems in spite of Microsoft


From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Eric Anderson Vianet SAO <eric(at)vianet-express(dot)com(dot)br>
Cc: "pgsql-sql (at) postgresql (dot) org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: \D TO FILE
Date: 2004-05-03 12:34:34
Message-ID: 20040503133434.A398@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql


On 03/05/2004 12:49 Eric Anderson Vianet SAO wrote:
> How could I record the ´ \d table ´ command to a file?

\o file

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SPAM] Re: Permissions not working
Date: 2004-05-03 13:33:01
Message-ID: 40964A0D.5070105@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Peter Eisentraut wrote:

>Pallav Kalva wrote:
>
>
>>Also here is the privileges information from information_schema
>>tables. Is there a way to REVOKE these
>>privileges ?
>>
>>
>
>You need to log in as the user that has granted the privilege you want
>to revoke. In this case, log in as postgres and do REVOKE ALL FROM
>PUBLIC;.
>
>
>
I did the same, still doesnt work . Here is the sequence of what I did .

---------------------------------------------------------------------------------------
[pkalva(at)timmy pkalva]$ psql usps postgres
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

usps=# revoke all on database usps from public,test;
REVOKE
usps=# \q
[pkalva(at)timmy pkalva]$ psql usps test
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

usps=> select * from citystate_alias limit 1;
detailcode | zipcode | aliasstreetpredir | aliasstreetname |
aliasstreetsuffix | aliasstreetpostdir | streetpredir | streetname |
streetsuffix | streetpostdir | typecode | century | year | month | day |
lownumber | highnumber | oddoreven | filler | entrydate
------------+---------+-------------------+--------------------------+-------------------+--------------------+--------------+------------+--------------+---------------+----------+---------+------+-------+-----+-----------+------------+-----------+--------+-------------------------------
A | 00501 | | INTERNAL REVENUE SERVICE
| | | | WAVERLY |
AVE | | O | 19 | 94 | 05 | 01
| | | | | 2004-04-22
14:51:45.497651-04
(1 row)

usps=>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pallav Kalva <pkalva(at)deg(dot)cc>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SPAM] Re: Permissions not working
Date: 2004-05-03 14:23:23
Message-ID: 13033.1083594203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Pallav Kalva <pkalva(at)deg(dot)cc> writes:
> I did the same, still doesnt work . Here is the sequence of what I did .

> usps=# revoke all on database usps from public,test;

You seem to think that that translates to revoking all privileges to
objects within the database. It doesn't. It only revokes privileges
directly associated with the database object, which are the rights to
create new schemas and temp tables within the database.

regards, tom lane


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SPAM] Re: Permissions not working
Date: 2004-05-03 15:06:01
Message-ID: 40965FD9.3020606@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql


>>usps=# revoke all on database usps from public,test;
>>
>>
>
>You seem to think that that translates to revoking all privileges to
>objects within the database. It doesn't. It only revokes privileges
>directly associated with the database object, which are the rights to
>create new schemas and temp tables within the database.
>
> regards, tom lane
>
>
>

Hi Tom,

I tried both database privileges and table privileges (all and
select) it still doesnt work. Not sure
what is wrong here, I tried logging in as both postgres and usps user
and both them doesnt work.

--------------------------------------------------------------------------------------------------------
[pkalva(at)timmy pkalva]$ psql usps postgres
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

usps=# revoke all privileges on citystate_alias from public,test;
REVOKE
usps=# \q
[pkalva(at)timmy pkalva]$ psql usps usps
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

usps=> revoke all privileges on citystate_alias from public,test;
REVOKE
usps=> revoke select on citystate_alias from public,test;
REVOKE
usps=> \q
[pkalva(at)timmy pkalva]$ psql usps test
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

usps=> select * from citystate_alias limit 1;
detailcode | zipcode | aliasstreetpredir | aliasstreetname |
aliasstre
etsuffix | aliasstreetpostdir | streetpredir | streetname | streetsuffix
|
stree
tpostdir | typecode | century | year | month | day | lownumber |
highnumber |
od
doreven | filler | entrydate
------------+---------+-------------------+--------------------------+----------
---------+--------------------+--------------+------------+--------------+------
---------+----------+---------+------+-------+-----+-----------+------------+---
--------+--------+-------------------------------
A | 00501 | | INTERNAL REVENUE SERVICE
|
| | | WAVERLY | AVE
|
| O | 19 | 94 | 05 | 01 | |
|
| | 2004-04-22 14:51:45.497651-04
(1 row)

usps=>


From: Arne Stoelck <stolck(at)web(dot)de>
To: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Cc: Eric Anderson Vianet SAO <eric(at)vianet-express(dot)com(dot)br>, "pgsql-sql (at) postgresql (dot) org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: \D TO FILE
Date: 2004-05-03 15:36:51
Message-ID: Pine.LNX.4.58.0405031535530.1064@darkstar.localnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Autre variante

psql nom_base -c '\d nom_table' > nom_fichier

Arne

On Mon, 3 May 2004, Paul Thomas wrote:

>
> On 03/05/2004 12:49 Eric Anderson Vianet SAO wrote:
> > How could I record the ´ \d table ´ command to a file?
>
> \o file
>


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pallav Kalva <pkalva(at)deg(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SPAM] Re: Permissions not working
Date: 2004-05-03 17:55:56
Message-ID: 200405031955.56052.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Pallav Kalva wrote:
> I tried both database privileges and table privileges (all and
> select) it still doesnt work. Not sure
> what is wrong here, I tried logging in as both postgres and usps user
> and both them doesnt work.

What about all those groups that have privileges? Please post the
output of \z when you try a revoke so we can verify what's going on.


From: Pallav Kalva <pkalva(at)deg(dot)cc>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SPAM] Re: Permissions not working
Date: 2004-05-03 18:28:19
Message-ID: 40968F43.1060305@deg.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Peter Eisentraut wrote:

>Pallav Kalva wrote:
>
>
>> I tried both database privileges and table privileges (all and
>>select) it still doesnt work. Not sure
>>what is wrong here, I tried logging in as both postgres and usps user
>>and both them doesnt work.
>>
>>
>
>What about all those groups that have privileges? Please post the
>output of \z when you try a revoke so we can verify what's going on.
>

here is the output. This is the same output, this output doesnt change
at all.

usps=> \z citystate_alias
Access privileges
for database "usps"
Schema | Table
| Access privileges
--------+-----------------+-----------------------------------------------------------------------------------------------------------------------
public | citystate_alias |
{postgres=a*r*w*d*R*x*t*/postgres,=r/postgres,usps=arwdRxt/postgres,"group
100=r/usps","group ea_development=r/usps"}
(1 row)