Sample Header Ad - 728x90

permission denied for schema ctgov; SQL state: 42501

1 vote
1 answer
1303 views
I am new to postgresql and I would grateful if you could please advise on how-to resolve the following error.. I have issued the followed commands:
VIEW cancer_view AS
SELECT sub1.nct_id, sub1.condition, sub1.condition_name,
		sub2.overall_status, sub2.participants,
		e.criteria,
		f.city, f.state, f.country,
		i.intervention_type, i.name AS intervention
FROM (SELECT c.nct_id, c.name AS condition, c.downcase_name AS condition_name
		FROM ctgov.conditions AS c
-- selecting only cancer trials before joining
		WHERE c.name ILIKE '%cancer%') sub1									
JOIN (SELECT s.nct_id, s.overall_status, s.enrollment AS participants
 		FROM ctgov.studies AS s
-- selecting only completed cancer trials before joining 	
	  	WHERE s.overall_status = 'Completed') sub2							
	ON sub1.nct_id = sub2.nct_id
JOIN ctgov.eligibilities AS e
	ON sub1.nct_id = e.nct_id
JOIN ctgov.facilities AS f
	ON sub1.nct_id = f.nct_id
JOIN ctgov.interventions AS i
	ON sub1.nct_id = i.nct_id;
And the error is: ERROR: permission denied for schema ctgov SQL state: 42501 Could you please advise on how to setup the privileges to have access to the tables defined in schema? Thank you in advance!!!
Asked by Lan (11 rep)
Feb 27, 2023, 05:04 AM
Last activity: Aug 7, 2025, 05:08 AM