Subject: | Support for Postgres via ODBC |
Hi Mark,
Nice job with the uploader library. I've been able to get it working with PostgreSQL 8.0.1 under WinXP via ODBC by adjusting the db_driver value if get_info(17) returns 'PostgreSQL'. I also had to delete an empty key from the entity hashref before it was returned in store_uploads. I don't know if this is a symptom of using ODBC or ActiveState Perl but that was causing SQL generation errors in the sample application (FriendsPhotos.pm). A patch is attached.
Thanks,
William
--- Uploader.pm.orig Sun Oct 31 08:49:10 2004
+++ Uploader.pm Tue Mar 29 08:27:27 2005
@@ -250,6 +250,7 @@
});
$in{db_driver} = $in{dbh}->{Driver}->{Name};
+ $in{db_driver} = 'Pg' if $in{dbh}->get_info(17) eq 'PostgreSQL';
unless (($in{db_driver} eq 'mysql') or ($in{db_driver} eq 'Pg')) {
die "only mysql and Pg drivers are supported at this time. ";
}
@@ -389,6 +390,7 @@
# Now add and delete as needed
my $entity = { %$form_data, %entity_all_extra };
map { delete $entity->{$_} } keys %{ $self->{spec} };
+ delete $entity->{''};
return $entity;
}