Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
c5d49902
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c5d49902
编写于
9月 25, 1997
作者:
E
Edmund Mergl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
*** empty log message ***
上级
4a98c576
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
67 addition
and
43 deletion
+67
-43
src/interfaces/perl5/Changes
src/interfaces/perl5/Changes
+4
-1
src/interfaces/perl5/Makefile.PL
src/interfaces/perl5/Makefile.PL
+19
-12
src/interfaces/perl5/Pg.pm
src/interfaces/perl5/Pg.pm
+2
-2
src/interfaces/perl5/Pg.xs
src/interfaces/perl5/Pg.xs
+1
-1
src/interfaces/perl5/README
src/interfaces/perl5/README
+11
-8
src/interfaces/perl5/eg/ApachePg.pl
src/interfaces/perl5/eg/ApachePg.pl
+10
-2
src/interfaces/perl5/eg/example.newstyle
src/interfaces/perl5/eg/example.newstyle
+8
-7
src/interfaces/perl5/eg/example.oldstyle
src/interfaces/perl5/eg/example.oldstyle
+4
-3
src/interfaces/perl5/test.pl
src/interfaces/perl5/test.pl
+7
-6
src/interfaces/perl5/typemap
src/interfaces/perl5/typemap
+1
-1
未找到文件。
src/interfaces/perl5/Changes
浏览文件 @
c5d49902
Revision history for Perl extension Pg.
1.6.3 Sep 25 1997
- README update
1.6.2 Sep 20 1997
- adapted to Postgre
sq
L-6.2:
- adapted to Postgre
SQ
L-6.2:
o added support for new method cmdTuples
o cmdStatus returns now for DELETE the status
followed by the number of affected rows,
...
...
src/interfaces/perl5/Makefile.PL
浏览文件 @
c5d49902
#-------------------------------------------------------
#
# $Id: Makefile.PL,v 1.
3 1997/09/17 20:46:20
mergl Exp $
# $Id: Makefile.PL,v 1.
4 1997/09/25 21:14:41
mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
#-------------------------------------------------------
use ExtUtils
::
MakeMaker;
use
Config;
use
strict;
print
"\nConfiguring Pg\n"
;
print
"Remember to actually read the README file !\n"
;
die
"\nYou didn't read the README file !\n"
unless
($]
>=
5.00
3
);
die
"\nYou didn't read the README file !\n"
unless
($]
>=
5.00
2
);
if
(!
$ENV{POSTGRES_HOME})
{
warn
"\$POSTGRES_HOME not defined. Searching for PostgreSQL...\n"
;
foreach(qw(/usr/
pgsql
/usr/local/pgsql
/usr/pgsql-6.1
/usr/local/pgsql-6.1
))
{
foreach(qw(/usr/
local/pgsql
/usr/pgsql
/home/pgsql
/opt/pgsql
/usr/local/postgres
/usr/postgres
/home/postgres
/opt/postgres
))
{
if
(-d
"$_/lib"
)
{
$ENV{POSTGRES_HOME}
=
$_
;
last;
...
...
@@ -22,17 +24,22 @@ if (! $ENV{POSTGRES_HOME}) {
}
}
if
(
$ENV{POSTGRES_HOME}
)
{
print
"
\n
Found PostgreSQL in $ENV{POSTGRES_HOME}\n"
;
if
(
-d
"$ENV{POSTGRES_HOME}/lib"
)
{
print
"Found PostgreSQL in $ENV{POSTGRES_HOME}\n"
;
}
else
{
die
"Unable to determine
\$POSTGRES_HOME !
\n"
;
die
"Unable to determine
PostgreSQL
\n"
;
}
WriteMakefile
(
'NAME'
=>
'Pg'
,
'VERSION_FROM'
=>
'Pg.pm'
,
'LIBS'
=>
[
"-L$ENV{POSTGRES_HOME}/lib -lpq"
]
,
'INC'
=>
"-I$ENV{POSTGRES_HOME}/include"
,
my
%
opts
=
(
NAME
=>
'Pg'
,
VERSION_FROM
=>
'Pg.pm'
,
INC
=>
"-I
$ENV
{POSTGRES_HOME}/include"
,
LIBS
=>
[
"-L
$ENV
{POSTGRES_HOME}/lib -lpq"
]
,
);
# EOF
WriteMakefile(%opts);
exit(0);
# end of Makefile.PL
src/interfaces/perl5/Pg.pm
浏览文件 @
c5d49902
#-------------------------------------------------------
#
# $Id: Pg.pm,v 1.
3 1997/09/17 20:46:21
mergl Exp $
# $Id: Pg.pm,v 1.
4 1997/09/25 21:14:43
mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
@@ -84,7 +84,7 @@ require 5.002;
PGRES_InvalidOid
)
;
$
Pg::
VERSION
=
'
1.6.
2
';
$
Pg::
VERSION
=
'
1.6.
3
';
sub
AUTOLOAD
{
# This AUTOLOAD is used to 'autoload' constants from the constant()
...
...
src/interfaces/perl5/Pg.xs
浏览文件 @
c5d49902
/*-------------------------------------------------------
*
* $Id: Pg.xs,v 1.
3 1997/09/17 20:46:21
mergl Exp $
* $Id: Pg.xs,v 1.
4 1997/09/25 21:14:44
mergl Exp $
*
* Copyright (c) 1997 Edmund Mergl
*
...
...
src/interfaces/perl5/README
浏览文件 @
c5d49902
#-------------------------------------------------------
#
# $Id: README,v 1.
3 1997/09/17 20:46:2
6 mergl Exp $
# $Id: README,v 1.
4 1997/09/25 21:14:4
6 mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
@@ -9,7 +9,7 @@
DESCRIPTION:
------------
This is version 1.6.
2
of pgsql_perl5 (previously called pg95perl5).
This is version 1.6.
3
of pgsql_perl5 (previously called pg95perl5).
Pgsql_perl5 is an interface between Larry Wall's language perl version 5 and
the database PostgreSQL (previously Postgres95). This has been done by using
...
...
@@ -85,14 +85,17 @@ Run 'make test'.
Note, that the user running this script must have been created with the access
rights to create databases *AND* users ! Do not run this script as root !
If you are using the shared library libpq.so, make sure, your dynamic loader
is able to find libpq.so. With Linux the command /sbin/ldconfig -v should tell
you, where it finds libpq.so. If not, you need to add an appropriate entry to
/etc/ld.so.conf or to the environment variable LD_LIBRARY_PATH.
If you are using the shared library libpq.so check if your dynamic loader
finds libpq.so. With Linux the command /sbin/ldconfig -v should tell you,
where it finds libpq.so. If ldconfig does not find libpq.so, either add an
appropriate entry to /etc/ld.so.conf and re-run ldconfig or add the path to
the environment variable LD_LIBRARY_PATH.
A typical error message resulting from not finding libpq.so is:
Can't load './blib/arch/auto/Pg/Pg.so' for module Pg: File not found at
Some linux distributions have an incomplete perl installation.
If you have compile errors like "XS_VERSION_BOOTCHECK undeclared", make a
'find
/usr
/lib/perl5 -name XSUB.h -print'
'find
...
/lib/perl5 -name XSUB.h -print'
If this file is not present, you need to recompile and reinstall perl.
...
...
@@ -105,6 +108,6 @@ installation to read the documentation.
---------------------------------------------------------------------------
Edmund Mergl <E.Mergl@bawue.de> September 2
0
, 1997
Edmund Mergl <E.Mergl@bawue.de> September 2
5
, 1997
---------------------------------------------------------------------------
src/interfaces/perl5/eg/ApachePg.pl
浏览文件 @
c5d49902
...
...
@@ -4,7 +4,7 @@
# - PostgreSQL-6.2
# - apache_1.2.4
# - mod_perl-1.00
# - perl5.004_0
1
# - perl5.004_0
3
use
CGI
;
use
Pg
;
...
...
@@ -30,7 +30,15 @@ if ($query->param) {
$conn
=
Pg::
connectdb
("
dbname =
$dbname
");
$cmd
=
$query
->
param
('
cmd
');
$result
=
$conn
->
exec
(
$cmd
);
$result
->
print
(
STDOUT
,
0
,
0
,
0
,
1
,
0
,
0
,
'',
'',
'');
print
"
<TABLE>
";
for
(
$i
=
0
;
$i
<
$result
->
ntuples
;
$i
++
)
{
print
"
<TR>
";
for
(
$j
=
0
;
$j
<
$result
->
nfields
;
$j
++
)
{
print
"
<TD>
",
$result
->
getvalue
(
$i
,
$j
),
"
</TD>
";
}
print
"
</TR>
";
}
print
"
</TABLE>
";
}
print
$query
->
end_html
;
...
...
src/interfaces/perl5/eg/example.newstyle
浏览文件 @
c5d49902
#!/usr/local/bin/perl
#!/usr/local/bin/perl
-w
#-------------------------------------------------------
#
# $Id: example.newstyle,v 1.
1 1997/09/17 20:48:14
mergl Exp $
# $Id: example.newstyle,v 1.
2 1997/09/25 21:15:02
mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
@@ -88,7 +88,7 @@ $SIG{PIPE} = sub { print "broken pipe\n" };
######################### create and connect to test database
# 2-4
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
cmp_eq
(
PGRES_CONNECTION_OK
,
$conn
->
status
);
# might fail if $dbname doesn't exist => don't check resultStatus
...
...
@@ -97,7 +97,7 @@ $result = $conn->exec("DROP DATABASE $dbname");
$result
=
$conn
->
exec
("
CREATE DATABASE
$dbname
");
cmp_eq
(
PGRES_COMMAND_OK
,
$result
->
resultStatus
);
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
cmp_eq
(
PGRES_CONNECTION_OK
,
$conn
->
status
);
######################### debug, PQtrace
...
...
@@ -141,7 +141,8 @@ for ($i = 1; $i <= 5; $i++) {
$result
=
$conn
->
exec
("
COPY person TO STDOUT
");
cmp_eq
(
PGRES_COPY_OUT
,
$result
->
resultStatus
);
$i
=
1
;
$i
=
1
;
$ret
=
0
;
while
(
-
1
!=
$ret
)
{
$ret
=
$conn
->
getline
(
$string
,
256
);
last
if
$string
eq
"
\\
.
";
...
...
@@ -217,7 +218,7 @@ if (! defined($pid = fork)) {
# i'm the child
sleep
2
;
bless
$conn
;
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
$result
=
$conn
->
exec
("
NOTIFY person
");
exit
;
}
...
...
@@ -277,7 +278,7 @@ if ($DEBUG) {
######################### disconnect and drop test database
# 60-61
$conn
= Pg::connectdb(
"
dbname
=
$dbmain
"
);
$conn
= Pg::connectdb(
"
dbname
=
$dbmain
"
);
cmp_eq(PGRES_CONNECTION_OK,
$conn
->status);
$result
=
$conn
->exec(
"
DROP
DATABASE
$dbname
"
);
...
...
src/interfaces/perl5/eg/example.oldstyle
浏览文件 @
c5d49902
#!/usr/local/bin/perl
#!/usr/local/bin/perl
-w
#-------------------------------------------------------
#
# $Id: example.oldstyle,v 1.
1 1997/09/17 20:48:15
mergl Exp $
# $Id: example.oldstyle,v 1.
2 1997/09/25 21:15:04
mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
@@ -148,7 +148,8 @@ $result = PQexec($conn, "COPY person TO STDOUT");
cmp_eq
(
PGRES_COPY_OUT
,
PQresultStatus
(
$result
));
PQclear
(
$result
);
$i
=
1
;
$i
=
1
;
$ret
=
0
;
while
(
-
1
!=
$ret
)
{
$ret
=
PQgetline
(
$conn
,
$string
,
256
);
last
if
$string
eq
"
\\
.
";
...
...
src/interfaces/perl5/test.pl
浏览文件 @
c5d49902
#!/usr/local/bin/perl
#!/usr/local/bin/perl
-w
#-------------------------------------------------------
#
# $Id: test.pl,v 1.
4 1997/09/17 20:53:35
mergl Exp $
# $Id: test.pl,v 1.
5 1997/09/25 21:14:47
mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
@@ -88,7 +88,7 @@ $SIG{PIPE} = sub { print "broken pipe\n" };
######################### create and connect to test database
# 2-4
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
cmp_eq
(
PGRES_CONNECTION_OK
,
$conn
->
status
);
# might fail if $dbname doesn't exist => don't check resultStatus
...
...
@@ -97,7 +97,7 @@ $result = $conn->exec("DROP DATABASE $dbname");
$result
=
$conn
->
exec
("
CREATE DATABASE
$dbname
");
cmp_eq
(
PGRES_COMMAND_OK
,
$result
->
resultStatus
);
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbname
");
cmp_eq
(
PGRES_CONNECTION_OK
,
$conn
->
status
);
######################### debug, PQtrace
...
...
@@ -141,7 +141,8 @@ for ($i = 1; $i <= 5; $i++) {
$result
=
$conn
->
exec
("
COPY person TO STDOUT
");
cmp_eq
(
PGRES_COPY_OUT
,
$result
->
resultStatus
);
$i
=
1
;
$i
=
1
;
$ret
=
0
;
while
(
-
1
!=
$ret
)
{
$ret
=
$conn
->
getline
(
$string
,
256
);
last
if
$string
eq
"
\\
.
";
...
...
@@ -218,7 +219,7 @@ if ($DEBUG) {
######################### disconnect and drop test database
# 49-50
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
$conn
=
Pg::
connectdb
("
dbname
=
$dbmain
");
cmp_eq
(
PGRES_CONNECTION_OK
,
$conn
->
status
);
$result
=
$conn
->
exec
("
DROP DATABASE
$dbname
");
...
...
src/interfaces/perl5/typemap
浏览文件 @
c5d49902
#-------------------------------------------------------
#
# $Id: typemap,v 1.
3 1997/09/17 20:46:2
9 mergl Exp $
# $Id: typemap,v 1.
4 1997/09/25 21:14:4
9 mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录