For Perl users - hope it helps somebody

Поиск
Список
Период
Сортировка
От Leo
Тема For Perl users - hope it helps somebody
Дата
Msg-id 000601c8e294$7f6790b0$232401c8@leo
обсуждение исходный текст
Ответы SetQueryTimeout in Postgres 8.1.4
Список pgsql-novice
Hello
If you use Perl (like me) I have made a very nice set of small programs to access any database, any table and add, change or delete data.
I like it better than using Webmin or PgAdmin because I can easily customize the screens.
 
To get all database names and encoding:
my $dbh = DBI->connect("dbi:Pg:dbname=template1", "postgres", "postgres");
my $select = $dbh->selectall_arrayref("select datname,encoding from pg_database ORDER BY datname ") or die $DBI::errstr;
To get all tables in a base:
my $dbh = DBI->connect("dbi:Pg:dbname=$base", "postgres", "postgres");
my @tnames = $dbh->tables(''); 
 
To get the field names in a table (nice for updates):
my @header = @{$sth->{'NAME'}};
my @types  = @{$sth->{'TYPE'}};
 
Hope somebody can use them
 
 
 
 

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Phillip Sitbon"
Дата:
Сообщение: Re: Concurrent COPY commands
Следующее
От: Brian Hurt
Дата:
Сообщение: SQL "pseudo-variables" for a view