Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | writing to a writeable PostgreSQL view does not work | ||
---|---|---|---|
Product: | Base | Reporter: | hjakobs <holger> |
Component: | code | Assignee: | AOO issues mailing list <issues> |
Status: | CONFIRMED --- | QA Contact: | |
Severity: | Trivial | ||
Priority: | P3 | CC: | issues, p9w.vu.31122010 |
Version: | OOo 2.4.1 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
hjakobs
2008-11-29 20:59:59 UTC
Checked to see if PostgreSQL itself (natively) can insert into views what is *NOT* the case. If I am wrong please feel free to correct me. This is what I did: demo=# \d packages Table "public.packages" Column | Type | Modifiers ----------+------------------------+------------------------------------------------------- id | bigint | not null default nextval('packages_id_seq'::regclass) name | character varying(100) | version | character varying(20) | url | character varying(200) | licenses | character varying(50) | groups | character varying(100) | size | numeric | idate | date | descr | text | demo=# create view vw_testqa as SELECT packages.id,packages.name from packages LIMIT 10; demo=# insert into vw_testqa (name) values ('asdasdasd asd'); ERROR: cannot insert into a view HINT: You need an unconditional ON INSERT DO INSTEAD rule. I am not an expert on how the rule system works and neither do I know how difficult it'd be to implement that in the OOo PSQL driver. Setting to ENHANC Please note that I wrote "if the view has been set up by a knowledgeable person". Yes, if you just set up a view without a rule it won't be writable. But since it is very easy for any PostgreSQL administrator to make certain views writable and certain views with Oracle are writable without any special treatment, it is still WRONG that OOo Base as a front end interferes and denies writing to a writable view. If a view is actually not writable, which is also very common, OOo Base should just take the error message from the database system and forward it to the user. Anything else is bad behaviour. |