Open KES777 opened 5 years ago
--- a/lib/SQL/Translator/Producer/PostgreSQL.pm
+++ b/lib/SQL/Translator/Producer/PostgreSQL.pm
@@ -756,9 +756,13 @@ sub create_procedure {
my @args = ();
foreach my $arg (@{$procedure->parameters}) {
$arg = {name => $arg} if ref($arg) ne 'HASH';
- push @args, join(' ', map $arg->{$_},
+ my $param = join(' ', map $arg->{$_},
grep defined($arg->{$_}),
qw/argmode name type/);
+ if( defined $arg->{ default } ) {
+ $param .= ' default ' .$arg->{ default };
+ }
+ push @args, $param;
}
$sql .= join(', ', @args);
$sql .= ')';
@rabbiveesh Hello. I saw recent updates. Is there a chance to apply this?
code example:
expected SQL: