[Q] 'CREATE FOREIGN TABLE' and 'INSERT INTO FDW' by dbase owner?

89 views
Skip to first unread message

Hiroyuki Sato

unread,
Nov 2, 2015, 12:34:04 AM11/2/15
to cstore users
Hello

It is possible to execute "CREATE FOREIGN TABLE" and 
"INSERT INTO FDW_TABLE SELECT * .." by dbowner (non-SuperUser)?


1, CREATE FOREIGN TABLE

  I executed "create foreign table" by database owner.
  I got following error.

  CREATE FOREIGN TABLE test_fdw
  (
      product_category TEXT,
      product_subcategory TEXT,
      similar_product_ids CHAR(10)[]
  )
  SERVER cstore_server
  OPTIONS(compression 'pglz');

  ERROR:  permission denied for foreign server cstore_server

2, INSERT INTO FDW_TABLE

  And also when I execute "INSERT INTO" by database owner.
  I got following error.

  insert into test_fdw select * from test_normal;
  ERROR:  permission denied for relation test_normal

When I execute those command by SuperUser, Both command worked properly.

Environment
 OSX: 10.11.1
 PostgreSQL 9.4.5
 cstore_fdw: 1.3


--
Hiroyuki Sato.

Murat Tuncer

unread,
Nov 2, 2015, 1:04:25 AM11/2/15
to Hiroyuki Sato, cstore users
Hello Hiroyuki

You will need to grant usage right to dbowner


use

grant usage on foreign server cstore_server to dbowner;



--
You received this message because you are subscribed to the Google Groups "cstore users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cstore-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Murat Tuncer
Software Engineer | Citus Data
mtu...@citusdata.com

Hiroyuki Sato

unread,
Nov 2, 2015, 1:34:03 AM11/2/15
to cstore users, hiro...@gmail.com
Hello Murat 

Thank you for replying.

I succeed to execute "CREATE FOREIGN TABLE" by dbowner.
But I can't execute "INSERT INTO FDW_TABLE" by dbowner.

I executed "GRANT INSERT ON test_fdw TO dbowner;"
And then I execute 'insert into..', but I got following error.

  insert into test_fdw select * from test_normal;
  ERROR:  permission denied for relation test_normal

Could you tell me how to do it?

Best regards.


2015年11月2日月曜日 15時04分25秒 UTC+9 Murat Tuncer:

Murat Tuncer

unread,
Nov 2, 2015, 1:47:16 AM11/2/15
to Hiroyuki Sato, cstore users
looks like you are lacking privileges on table test_normal. 
Could you check if you can issue "select * from test_normal" ?

Hiroyuki Sato

unread,
Nov 2, 2015, 2:05:43 AM11/2/15
to cstore users, hiro...@gmail.com
Hello Murat.

Thank you for replying. 

You were right.
I succeed to insert data after execute
alter table test_normal owner to dbowner; 

summary.

Thanks again.




2015年11月2日月曜日 15時47分16秒 UTC+9 Murat Tuncer:
Reply all
Reply to author
Forward
0 new messages