[DBIx-Class-Devel] [dbsrgits/sql-translator] PostgreSQL: add support for TRIGGERs and FUNCTIONs (#82)

Eugen Konkov notifications at github.com
Thu Jan 26 19:46:46 GMT 2017


Just harcoding `DROP FUNCTION` does not help. We should reuse code
```
diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm
index ebe39e4..298e0cb 100644
--- a/lib/SQL/Translator/Producer/PostgreSQL.pm
+++ b/lib/SQL/Translator/Producer/PostgreSQL.pm
@@ -713,7 +713,7 @@ sub create_procedure {
 
   my @statements;
 
-  push @statements, sprintf( 'DROP FUNCTION IF EXISTS %s', $generator->quote($procedure->name) )
+  push @statements, drop_procedure( $procedure )
     if $options->{add_drop_procedure};
 
   my $sql = 'CREATE FUNCTION ';
```

otherwise we get: `ERROR:  syntax error at end of input`

    LINE 1: DROP FUNCTION IF EXISTS "ch_saldo"


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/issues/82#issuecomment-275492781
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20170126/7a62c861/attachment.htm>


More information about the DBIx-Class-Devel mailing list