| 1 | package Database::Wrapper::Postgres; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use lib qw(../..); | ||
| 5 | use base qw(Database::Wrapper); | ||
| 6 | |||
| 7 | our $VERSION = "1.04"; | ||
| 8 | # $Id: Postgres.pm,v 1.3 2005/11/26 00:37:34 incorpoc Exp $ | ||
| 9 | |||
| 10 | =pod | ||
| 11 | |||
| 12 | Filter out all but tables | ||
| 13 | |||
| 14 | =cut | ||
| 15 | |||
| 16 | sub GetTableNames($) | ||
| 17 | { | ||
| 18 | my ($self) = (shift); | ||
| 19 | |||
| 20 | my $raAllSchemas = [$self->{dbh}->tables('', '', '', 'TABLE')]; | ||
| 21 | ## If it starts with 'public.', we want it | ||
| 22 | my $raTables = [grep {$_ = (/^public\./o)? $' : undef} @$raAllSchemas]; | ||
| 23 | # Remove quotes | ||
| 24 | $raTables = [grep {s/\"//go; 1;} @$raTables]; | ||
| 25 | |||
| 26 | return $raTables; | ||
| 27 | } | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __END__ |