将代码移植到Postgresql [英] Porting Code to Postgresql

查看:73
本文介绍了将代码移植到Postgresql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


不确定这是一个关于php列表还是这个问题的问题,但我会给它

a shot and

如果我错了,请不要把我钉在十字架上。 :-)


有一个基于php的sourceforge项目叫做mailwatch。

http://www.sourceforge.net/projects/mailwatch )它将来自优秀的

Mailscanner安全产品的数据记录到一个mysql数据库。现在,我不是一个php

程序员,

我几乎不是Postgres DBA,但我真的想将代码移植到

Postgresql。

我信任Postgresql Book,其中包含Postgresql的API和

PHP语句

用于Postgresql似乎几乎相同那些用于Mysql的。我了解b





$ b postgresql支持的数据类型有些细微差别但是差异很大
两个数据库和API之间的
非常适合无法完成任务的任务

一个没有经验的人

如我自己?我们目前使用Postgresql和sendmail一起使用
存储我们的访问权限,mailertable

和其他db',所以我们实现这一目标会非常方便。最好的问候,


Errol U. Neal

---------------- -----------(播出结束)---------------------------

提示5:您是否检查了我们广泛的常见问题解答?

http://www.postgresql.org/docs/faqs/FAQ.html

Hi all,

Not sure if this is a question for a php list or this one, but I''ll give it
a shot and
if I am wrong, please do not crucify me. :-)

There is a php based sourceforge project called mailwatch.
(http://www.sourceforge.net/projects/mailwatch) It logs data from the excellent
Mailscanner security product into a mysql database. Now, I am not a php
programmer,
and I am barely a Postgres DBA, but I would really like to port the code to
Postgresql.
I have my trust Postgresql Book which covers the API for Postgresql and the
PHP statements
used for Postgresql seem almost identical to those used for Mysql. I
understand that there are
some slight differences in the data types supported by Mysql and
Postgresql, however are the differences
between the two Databases and API''s that great to make task impossible for
an unexperienced person
such as myself? We currently use Postgresql in conjunction with sendmail to
store our access, mailertable
and other db''s, so it would be very convenient for us to achieve this.
Best Regards,

Errol U. Neal
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

推荐答案

On 2003年10月15日星期三10:16:29 -0400 Errol Neal< sy ******* @ enhtech.com>写道:
On Wed, 15 Oct 2003 10:16:29 -0400 Errol Neal <sy*******@enhtech.com> wrote:
有一个基于php的sourceforge项目叫做mailwatch。
http://www.sourceforge.net/projects/mailwatch )它将优秀的Mailscanner安全产品中的数据记录到mysql数据库中。现在,我不是一个php
程序员,我几乎不是Postgres DBA,但我真的很想将代码移植到Postgresql。
我信任Postgresql涵盖Postgresql
....的API以及用于Postgresql的PHP语句看起来几乎与用于Mysql的那些相同。我明白在Mysql和Postgresql支持的数据类型方面存在一些细微的差别,但两个数据库和API之间存在的差异很大。让一个无经验的人无法完成任务
比如我自己?
There is a php based sourceforge project called mailwatch.
(http://www.sourceforge.net/projects/mailwatch) It logs data from the excellent
Mailscanner security product into a mysql database. Now, I am not a php
programmer,
and I am barely a Postgres DBA, but I would really like to port the code to
Postgresql.
I have my trust Postgresql Book which covers the API for Postgresql .... and the PHP statements
used for Postgresql seem almost identical to those used for Mysql. I
understand that there are
some slight differences in the data types supported by Mysql and
Postgresql, however are the differences
between the two Databases and API''s that great to make task impossible for
an unexperienced person
such as myself?




只要你是的,它就不会太糟糕愿意学习。


注意案例折叠问题。我最终总是把我的桌子

名字和列名都降低了,因为php的行为与

的情况一样。如果你有混合的案例,那么最终你会最终花掉很多时间来追逐烦人的,愚蠢的错误,因为php没有

需要变量来初始化,它只是创建它们,所以你可以结束

引用



it shouldn''t be too awful as long as you''re willing to learn.

watch for case folding issues. i ultimately ended up always making my table
names and column names all lower because of the way that php behaves with
case. if you have mixed case stuff, then ultimately you will end up
spending a lot of time chasing annoying, stupid bugs because php doesn''t
require variables to be initialized, it just creates them, so you could end
up referencing


row-> ColumnName并获取null因为php把它放在
row->ColumnName and getting null because php put it in


row-> columnname。


迭代结果集时,请注意至少在某些版本中

php-> postgresql界面,

while(
row->columnname.

when iterating over a result set, be aware that in at least some versions
of the php->postgresql interface,

while(


这篇关于将代码移植到Postgresql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆