Permalink
Browse files

Support Vertica 6.

Simply by using VARCHAR instead of LONG VARCHAR in the log table.
Also, make sure that the Vertica engine requires DBD::ODBC, not
DBD::Pg.
  • Loading branch information...
theory committed Sep 5, 2014
1 parent 747fa83 commit 4f8dbaa236a04f6dd1ec762250ffd8481078691a
Showing with 10 additions and 1 deletion.
  1. +3 −0 Changes
  2. +7 −1 lib/App/Sqitch/Engine/vertica.pm
View
@@ -1,6 +1,9 @@
Revision history for Perl extension App::Sqitch
0.997
+ - At runtime, the Vertica engine now properly requires DBD::ODBC
+ instead of DBD::Pg.
+ - The Vertica engine now supports Vertica 6, as documented.
0.996 2014-09-05T21:11:00Z
- Fixed one more test failure due to the introduction of "Negative repeat
@@ -16,7 +16,7 @@ our $VERSION = '0.997';
sub key { 'vertica' }
sub name { 'Vertica' }
-sub driver { 'DBD::Pg 2.0' }
+sub driver { 'DBD::ODBC 1.43' }
sub default_client { 'vsql' }
has '+destination' => (
@@ -154,13 +154,19 @@ sub initialize {
schema => $schema
) if $self->initialized;
+ # Check the database version.
+ my $vline = $self->dbh->selectcol_arrayref('SELECT version()')->[0];
+ my ($maj) = $vline =~ /\bv?(\d+)/;
+
my $file = file(__FILE__)->dir->file('vertica.sql');
# Need to write a temp file; no :"registry" variable syntax.
($schema) = $self->dbh->selectrow_array(
'SELECT quote_ident(?)', undef, $schema
);
(my $sql = scalar $file->slurp) =~ s{:"registry"}{$schema}g;
+ # No LONG VARCHAR before Vertica 7.
+ $sql =~ s/LONG //g if $maj < 7;
require File::Temp;
my $fh = File::Temp->new;
print $fh $sql;

0 comments on commit 4f8dbaa

Please sign in to comment.