Skip Menu |
 

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 47889
Status: new
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: ddascalescu+perl [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Impossible to create writable views via triggers
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 862
Download (untitled) / with headers
text/plain 862b
(copied from https://sourceforge.net/tracker/?func=browse&group_id=47619&atid=450052, in hopes it gets more attention.) Writable views could be implemented via triggers, except that the 'on_table' parameter to SQL::Translator::Schema::Trigger->new() wants a real table ("Table named visits_expanded doesn't exist at ...SQL/Translator/Schema/Trigger.pm line 237"). However, in PostgreSQL, adding a trigger to a view is perfectly legal, and the correct way of making a writable view: CREATE OR REPLACE RULE mytable_expanded_update AS ON UPDATE TO mytable_expanded DO INSTEAD UPDATE mytable SET comment = new.comment WHERE mytable.id = new.id The view was created earlier in the code: my $view_writable = SQL::Translator::Schema::View->new( name => 'mytable_expanded', sql => 'SELECT ... ' ) Would be great if triggers could be added to views as well.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.