[ https://issues.apache.org/jira/browse/MADLIB-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jingyi Mei updated MADLIB-1275: ------------------------------- Description: Repro: login to your database {code:java} set search_path=madlib,public,"$user";{code} manually create a table "vertex": {code:java} DROP TABLE IF EXISTS vertex, "EDGE"; CREATE TABLE vertex( id INTEGER ); INSERT INTO vertex VALUES (0), (1), (2), (3), (4), (5), (6);{code} Then run dev-check for pagerank: {code:java} ./src/bin/madpack -p greenplum -c /madlib dev-check -t graph/pagerank{code} Then it will fail and here is the error message: {code:java} DROP TABLE IF EXISTS vertex, "EDGE"; 28 psql:/tmp/madlib.Ph19IE/graph/pagerank.sql_in.tmp:28: ERROR: must be owner of relation vertex{code} Cause: When user manually creates vertex table, it goes to madlib schema because of the search_path settings/ When running Install/Dev check, madpack will set {code:java} SET search_path=madlib_installcheck_graph,madlib;{code} During dev-check, it tries to drop vertex table and found it under madlib schema, it will fail because it was another user that created vertex table in the same schema. Solution: 1) In madpack, only SET search_path=madlib_installcheck_graph and remove madlib schema. 2) In all the Install/Dev check sql files, when we call madlib function, we explicitly call \{schema_madlib}.function_name instead of directly call function_name and let it go through search_path. was: Repro: login to your database {code:java} set search_path=madlib,public,"$user";{code} manually create a table "vertex": {code:java} DROP TABLE IF EXISTS vertex, "EDGE"; CREATE TABLE vertex( id INTEGER ); INSERT INTO vertex VALUES (0), (1), (2), (3), (4), (5), (6);{code} Then run dev-check for pagerank: {code:java} ./src/bin/madpack -p greenplum -c /madlib dev-check -t graph/pagerank{code} Then it will fail and here is the error message: {code:java} DROP TABLE IF EXISTS vertex, "EDGE"; 28 psql:/tmp/madlib.Ph19IE/graph/pagerank.sql_in.tmp:28: ERROR: must be owner of relation vertex{code} Cause: When user manually creates vertex table, it goes to madlib schema because of the search_path settings/ When running Install/Dev check, madpack will set {code:java} SET search_path=madlib_installcheck_graph,madlib;{code} During dev-check, it tries to drop vertex table and found it under madlib schema, it will fail because it was another user that created vertex table in the same schema. Solution: 1) In madpack, only SET search_path=madlib_installcheck_graph and remove madlib schema. 2) In all the Install/Dev check sql file, when we call madlib function, we explicitly call \{schema_madlib}.function_name instead of directly call function_name and let it go through search_path. > dev-check user doesn't have right privilege to create/drop table > ----------------------------------------------------------------- > > Key: MADLIB-1275 > URL: https://issues.apache.org/jira/browse/MADLIB-1275 > Project: Apache MADlib > Issue Type: Bug > Components: Madpack > Reporter: Jingyi Mei > Priority: Minor > > Repro: > login to your database > {code:java} > set search_path=madlib,public,"$user";{code} > manually create a table "vertex": > {code:java} > DROP TABLE IF EXISTS vertex, "EDGE"; > CREATE TABLE vertex( > id INTEGER > ); > INSERT INTO vertex VALUES > (0), > (1), > (2), > (3), > (4), > (5), > (6);{code} > Then run dev-check for pagerank: > {code:java} > ./src/bin/madpack -p greenplum -c /madlib dev-check -t graph/pagerank{code} > > Then it will fail and here is the error message: > {code:java} > DROP TABLE IF EXISTS vertex, "EDGE"; > 28 psql:/tmp/madlib.Ph19IE/graph/pagerank.sql_in.tmp:28: ERROR: must be owner > of relation vertex{code} > > Cause: > When user manually creates vertex table, it goes to madlib schema because of > the search_path settings/ > When running Install/Dev check, madpack will set > {code:java} > SET search_path=madlib_installcheck_graph,madlib;{code} > During dev-check, it tries to drop vertex table and found it under madlib > schema, it will fail because it was another user that created vertex table in > the same schema. > > Solution: > 1) In madpack, only SET search_path=madlib_installcheck_graph and remove > madlib schema. > 2) In all the Install/Dev check sql files, when we call madlib function, we > explicitly call \{schema_madlib}.function_name instead of directly call > function_name and let it go through search_path. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)