📄 postgresql-howto-11.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> <META NAME="GENERATOR" CONTENT="ZH-SGML-Tools 1.0.9"> <TITLE> Linux 的 Database-SQL-RDBMS HOW-TO 文件 (PostgreSQL 物件关联资料库系统): PostgreSQL 的 Perl 资料库介面 (Database Interface, DBI) </TITLE> <LINK HREF="PostgreSQL-HOWTO-12.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-12.html" REL=next> <LINK HREF="PostgreSQL-HOWTO-10.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-10.html" REL=previous> <LINK HREF="PostgreSQL-HOWTO.html#toc11" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO.html#toc11" REL=contents><SCRIPT src="menu.js"> function BeginPage() {} function EndPage() {} </SCRIPT> </HEAD> <BODY bgcolor=#FFFFFF MARGINHEIGHT=0 MARGINWIDTH=0> <A HREF="PostgreSQL-HOWTO-12.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-12.html"><IMG SRC="next.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/next.gif" ALT="Next"></A><A HREF="PostgreSQL-HOWTO-10.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-10.html"><IMG SRC="prev.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/prev.gif" ALT="Previous"></A><A HREF="PostgreSQL-HOWTO.html#toc11" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO.html#toc11"><IMG SRC="toc.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/toc.gif" ALT="Contents"></A><HR><H2><A NAME="Perl Database Interface"></A> <A NAME="s11">11. PostgreSQL 的 Perl 资料库界面 (Database Interface, DBI) </A></H2><P><H2><A NAME="ss11.1">11.1 PostgreSQL 的 PERL 5 界面</A></H2><P>PERL 是‘Practical Exptraction and Report Language’的简写。世上所有软硬件平台都可使用 Perl。你所在视窗 95/NT、苹果麦金塔 iMac、所有 Unix (Solaris、HPUX、AIX、Linux、Irix、SCO 等等)、大型电脑 MVS、桌面的 OS/2、OS/400、Amdahl UTS 和其他很多电脑。Perl <B>甚至</B>可在很多不流行和不为人知的操作系统和硬件执行!!所以,在看到 Perl 在一个罕见的操作系统上执行时,不必大惊小怪。你可以想像到 Perl 的使用者和开发人员的数量。<P>PostgreSQL 的 Perl 界面已包括在 PostgreSQL 的散布中。请参看 src/pgsql_perl5 目录。<UL><LI> Pgsql_perl5 电邮联络地址∶<A HREF="mailto:E.Mergl@bawue.de">E.Mergl@bawue.de</A></LI><LI>另一资料来源∶<A HREF="javascript:if(confirm('ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz'" tppabs="ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz">ftp://ftp.kciLink.com/pub/PostgresPerl-1.3.tar.gz</A></LI><LI> Perl 网页<A HREF="javascript:if(confirm('http://www.perl.com/perl/index.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/perl/index.html'" tppabs="http://www.perl.com/perl/index.html">http://www.perl.com/perl/index.html</A></LI><LI> Perl 导引,请在 <A HREF="javascript:if(confirm('http://reference.perl.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/'" tppabs="http://reference.perl.com/">http://reference.perl.com/</A> 参看导引目录</LI><LI> Perl FAQ 在 <A HREF="javascript:if(confirm('http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/'" tppabs="http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/">http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/</A></LI><LI> Perl GUI 使用者界面 Perl-Qt rpm∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A> 也请看 PerlQt-1.06-1.i386.rpm</LI><LI> Perl GUI 使用者界面 Perl-Qt∶<A HREF="javascript:if(confirm('http://www.accessone.com/~jql/perlqt.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.accessone.com/~jql/perlqt.html'" tppabs="http://www.accessone.com/~jql/perlqt.html">http://www.accessone.com/~jql/perlqt.html</A></LI><LI> Perl GUI 使用者界面 Perl-XForms∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A>,寻找 Xforms4Perl-0.8.4-1.i386.rpm</LI><LI> Perl GUI 使用者界面 Perl-Tk∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A></LI><LI> Perl GUIkits∶<A HREF="javascript:if(confirm('http://reference.perl.com/query.cgi?ui \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/query.cgi?ui'" tppabs="http://reference.perl.com/query.cgi?ui">http://reference.perl.com/query.cgi?ui</A></LI><LI> Perl 资料库界面∶<A HREF="javascript:if(confirm('http://reference.perl.com/query.cgi?database \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/query.cgi?database'" tppabs="http://reference.perl.com/query.cgi?database">http://reference.perl.com/query.cgi?database</A></LI><LI> Perl 到 "C" 的翻译工具∶<A HREF="javascript:if(confirm('http://www.perl.com/CPAN-local/modules/by-module/B/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN-local/modules/by-module/B/'" tppabs="http://www.perl.com/CPAN-local/modules/by-module/B/">http://www.perl.com/CPAN-local/modules/by-module/B/</A>寻找 Compiler-a3.tar.gz</LI><LI> Bourne shell 到 Perl 的翻译工具∶<A HREF="javascript:if(confirm('http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz'" tppabs="http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz">http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz</A></LI><LI> awk 到 perl 的 a2p 和 sed 到 perl 的 s2p 已包括在 PERL 散布中。</LI><LI> 也请看 comp.lang.perl.* 等有关 PERL 的新闻组</LI></UL><H2><A NAME="ss11.2">11.2 Perl 资料库界面 DBI</A></H2><H3>何谓 DBI?</H3><P>Perl 资料库界面(DBI)是 Perl 语言的一个资料库存取应用程序界面(API)。Perl DBI API 规格定义了一组函数、变数和惯例,以提供一个一致而独立于实际所用的资料库界面。有关 DBI 的这一段的资料是来自‘DBI FAQ’文件,作者是 Alligator Descartes,并获准在此复制。<UL><LI> Alligator Descartes Hermetica 在 <A HREF="mailto:descarte@hermetica.com">descarte@hermetica.com</A></LI></UL><H3>PostgreSQL 的 DBI 驱动程序 DBD-Pg-0.89</H3><P>在此取得 DBD-Pg-0.89.tar.gz∶<UL><LI> DBD-Pg-0.89 : <A HREF="javascript:if(confirm('http://www.perl.com/CPAN/modules/by-module/DBD/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN/modules/by-module/DBD/'" tppabs="http://www.perl.com/CPAN/modules/by-module/DBD/">http://www.perl.com/CPAN/modules/by-module/DBD/</A></LI><LI>Comprehensive Perl Archive Network CPAN <A HREF="javascript:if(confirm('http://www.perl.com/CPAN \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN'" tppabs="http://www.perl.com/CPAN">http://www.perl.com/CPAN</A></LI><LI> DBI 驱动程序名单和 DBI 模块网页 <A HREF="javascript:if(confirm('http://www.hermetica.com/technologia/perl/DBI \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.hermetica.com/technologia/perl/DBI'" tppabs="http://www.hermetica.com/technologia/perl/DBI">http://www.hermetica.com/technologia/perl/DBI</A></LI><LI> DBI 的资料在 <A HREF="javascript:if(confirm('http://www.fugue.com/dbi/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.fugue.com/dbi/'" tppabs="http://www.fugue.com/dbi/">http://www.fugue.com/dbi/</A></LI><LI> 主网页 <A HREF="javascript:if(confirm('ftp://ftp.demon.co.uk/pub/perl/db \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.demon.co.uk/pub/perl/db'" tppabs="ftp://ftp.demon.co.uk/pub/perl/db">ftp://ftp.demon.co.uk/pub/perl/db</A></LI><LI> 杂锦 DBI 连结 <A HREF="javascript:if(confirm('http://www-ccs.cs.umass.edu/db.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www-ccs.cs.umass.edu/db.html'" tppabs="http://www-ccs.cs.umass.edu/db.html">http://www-ccs.cs.umass.edu/db.html</A></LI><LI> 杂锦 DBI 连结 <A HREF="javascript:if(confirm('http://www.odmg.org/odmg93/updates_dbarry.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.odmg.org/odmg93/updates_dbarry.html'" tppabs="http://www.odmg.org/odmg93/updates_dbarry.html">http://www.odmg.org/odmg93/updates_dbarry.html</A></LI><LI> 杂锦 DBI 连结 <A HREF="javascript:if(confirm('http://www.jcc.com/sql_stnd.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.jcc.com/sql_stnd.html'" tppabs="http://www.jcc.com/sql_stnd.html">http://www.jcc.com/sql_stnd.html</A></LI><LI>PostgreSQL 资料库 <A HREF="javascript:if(confirm('http://www.postgresql.org/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.postgresql.org/'" tppabs="http://www.postgresql.org/">http://www.postgresql.org</A></LI></UL><P>系统需求∶<UL><LI> - 建立、测试和安装 Perl 5 (最少 5.002)</LI><LI> - 建立、测试和安装 DBI 模块 (最少 0.89)</LI><LI> - 建立、测试和安装 PostgreSQL (最少 6.2)</LI></UL><H3>DBI 的技术支持</H3><P>请把意见和错误报告寄到<UL><LI> <A HREF="mailto:E.Mergl@bawue.de">E.Mergl@bawue.de</A></LI></UL><P>请把以 perl -v、perl -V 的输出、PostgreSQL 的版本、DBD-Pg 的版本、DBI 的版本包括在错误报告中。<P><H3>何谓 DBI、DBperl、Oraperl 和 *perl?</H3><P>摘录自 Tim Bunce,DBI 的设计者和作者∶<P>“DBI 是 Perl 语言的一种应用程序界面(API)。Perl DBI API 规格定义了一组函数、变数和惯例,用于提供一个一致而独立于实际所用的资料库界面。”<P>简单地说,DBI 容许用家透明地 (transparently) 存取多种资料库。所以,如果你连接到 Oracle、Informix、mSQL、Sybase 或任何资料库,你不需要知道 3GL 层面内里的机制。DBI 所定义的 API 可用于所有这些资料库。<P>这样的好处是你得到在一篇 perl 手稿中连接两个不同出版商不同的资料库,例如在一个程序中读取在一个 Oracle 资料库的资料及将它插入到 Informix 资料库中。DBI 层面容许你简单及有力地做到。<P>DBperl 是这个界面规格的旧名。它现在一般用于代表用于 perl4 的资料库界面模块,如oraperl、isqlperl、ingperl 之类。这些界面没有标准的 API,一般已没有支持。<P>这是 DBperl 模块的名单,所对应的 DBI 模块及技术支持信息。有关 DBI 驱动程序的问题应该在 dbi-users 通讯论坛提出。list.<BLOCKQUOTE><CODE><PRE> 模块名称 所需资料库 作者 DBI ----------- ----------------- ------ --- Sybperl Sybase Michael Peppler DBD::Sybase <mpeppler@datamig.com> http://www.mbay.net/~mpeppler Oraperl Oracle 6 & 7 Kevin Stock DBD::Oracle <dbi-users@fugue.com> Ingperl Ingres Tim Bunce & DBD::Ingres
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -