[BUGS] BUG #6116: Not able to drop user if S/he has permission on tablespace

2011-07-13 Thread tushar

The following bug has been logged online:

Bug reference:  6116
Logged by:  tushar
Email address:  tushar...@gmail.com
PostgreSQL version: 9.0
Operating system:   Fedora 14
Description:Not able to drop user if S/he has permission on
tablespace
Details: 

Steps to reproduce


\\create a directory 

postgres=# \! mkdir /tmp/g100

\\create a tablespace 
postgres=#  CREATE TABLESPACE f location '/tmp/g100';
CREATE TABLESPACE

\\create a User 
postgres=# CREATE user abc;
CREATE ROLE

\\grant all on tablespace to user 

postgres=# GRANT all on TABLESPACE f to abc;
GRANT

\\drop permission from user 

postgres=# drop owned by abc;
DROP OWNED

\\ Try to drop User 
postgres=# drop user abc ;
ERROR:  role "abc" cannot be dropped because some objects depend on it
DETAIL:  privileges for tablespace f
postgres=#

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


[BUGS] BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?

2011-07-13 Thread Aleksey Tsalolikhin

The following bug has been logged online:

Bug reference:  6117
Logged by:  Aleksey Tsalolikhin
Email address:  atsaloli.t...@gmail.com
PostgreSQL version: 8.4.8
Operating system:   CentOS 5.5 (64-bit)
Description:psql -c does not work as expected.  a documentation bug?
 a program bug?
Details: 

The psql man page says, in the section for the -c option:

If the command string contains multiple SQL 
commands, they are processed in a  single
transaction

However when I run a command string with multiple
SQL commands, apparently only the last one is
processed.


For example:


# psql -U postgres -c  "select now();  select now(); select version();"
 version
 

--
 PostgreSQL 8.4.8 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC)
4.1.2 20080704 (Red Hat 4.1.2-48), 64-bit
(1 row)

#

Yet this works fine:

# echo "select now();  select now(); select version();"|psql -f- -U postgres

  now  
---
 2011-07-13 13:51:01.594725-07
(1 row)

  now  
---
 2011-07-13 13:51:01.597903-07
(1 row)

 version
 

--
 PostgreSQL 8.4.8 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC)
4.1.2 20080704 (Red Hat 4.1.2-48), 64-bit
(1 row)

#


This is what I expect to see.


Could you please fix psql or make the documentation for the -c option more
clear?

Thanks very much and thanks for a great product!

Yours truly,
Aleksey

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


Re: [BUGS] BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?

2011-07-13 Thread Craig Ringer

On 14/07/2011 4:53 AM, Aleksey Tsalolikhin wrote:

The following bug has been logged online:

Bug reference:  6117
Logged by:  Aleksey Tsalolikhin
Email address:  atsaloli.t...@gmail.com
PostgreSQL version: 8.4.8
Operating system:   CentOS 5.5 (64-bit)
Description:psql -c does not work as expected.  a documentation bug?
  a program bug?
Details:

The psql man page says, in the section for the -c option:

 If the command string contains multiple SQL
 commands, they are processed in a  single
 transaction

However when I run a command string with multiple
SQL commands, apparently only the last one is
processed.

What's happening is that all of them are processed, but only the output 
for the last one is emitted. I agree that the documentation isn't clear 
about that, and I'm not sure whether or not that was the intended result.


psql -c "CREATE TABLE test(x integer); INSERT INTO test(x) VALUES 
(1),(2),(3); SELECT version(); SELECT * FROM test;"

 x
---
 1
 2
 3
(3 rows)


Comments anybody? Just fix the docs, or is this a behaviour issue?

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

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