Problem with insert related to different schemas

From: Gonzalo Aguilar Delgado <gaguilar(at)level2crm(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Problem with insert related to different schemas
Date: 2010-04-14 08:23:22
Message-ID: 1271233402.10390.5.camel@azul1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Everyone,

I've come along with a problem that appeared with latest version of
Postgresql 8.4.2.

I'm trying to insert a row in the analysis schema:

INSERT INTO
"analisys"."response_quality" ("uuid","id_survey_question","id_survey","id_survey_status","id_shop","survey_question_response","id_survey_answer","date_survey_answer") VALUES ('83968de5-eac7-4f52-bbec-7392a198f556',7,1,1,16,3,9987,'2009-12-01 00:00:00.000000 +01:00:00')

But it fails because:

ERROR: permiso denegado al esquema public
LÍNEA 1: SELECT 1 FROM ONLY "public"."survey_question" x WHERE "id_su...
^
CONSULTA: SELECT 1 FROM ONLY "public"."survey_question" x WHERE
"id_survey_question" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x

********** Error **********

ERROR: permiso denegado al esquema public
Estado SQL:42501

Surely it may have something to do with foreign keys.

But the user who executes this query has access to all foreign keys
tables...

Then why I'm receiving this error?

Thank you in advance!

NOTE:
-- Table: analisys.response_quality

-- DROP TABLE analisys.response_quality;

CREATE TABLE analisys.response_quality
(
uuid uuid NOT NULL,
id_survey_question integer NOT NULL,
id_survey integer NOT NULL,
id_survey_status integer NOT NULL,
id_shop integer NOT NULL,
survey_question_response integer,
id_survey_answer integer NOT NULL,
date_survey_answer date NOT NULL,
CONSTRAINT "primary" PRIMARY KEY (uuid, id_survey_answer,
id_survey_question, date_survey_answer, id_shop, id_survey),
CONSTRAINT question FOREIGN KEY (id_survey_question)
REFERENCES survey_question (id_survey_question) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT survey FOREIGN KEY (id_survey)
REFERENCES survey_surveys (id_survey) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Splivalo 2010-04-14 09:48:43 Using CASE in plpgsql causes 'ERROR: cache lookup failed'
Previous Message Feixiong Li 2010-04-14 04:33:30 How to max() make null as biggest value?