473,748 Members | 5,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with PostgreSQL porting project

Hi all;

A few years ago, I set about porting a PHP application from MySQL to
PostgreSQL, after realizing that MySQL wasn't going to be able to handle it.
In order to do this, I built a light, fast database abstraction layer which
conforms to the behavior of the MySQL functions in PHP. This means that a
large amount of porting work could be made simple using this porting layer
if the application was originally used PHP's native MySQL functions rather
than a standard porting layer. The application was originally released
under the GPL.

I am pleased to announce that I have been able to secure permission from all
contributors to be able to re-release this under the LGPL, so that it can be
used with non-GPL programs.

If there is interest in this project, please let me know.

Best Wishes,
Chris Travers
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
4 2389
Hi,

On Fri, 2004-01-02 at 13:38, Chris Travers wrote:
A few years ago, I set about porting a PHP application from MySQL to
PostgreSQL, after realizing that MySQL wasn't going to be able to handle it.
In order to do this, I built a light, fast database abstraction layer which
conforms to the behavior of the MySQL functions in PHP. This means that a
large amount of porting work could be made simple using this porting layer
if the application was originally used PHP's native MySQL functions rather
than a standard porting layer. The application was originally released
under the GPL.


I guess it might bother you when people ask this but, what made you do
the hardwork while it's already been done by several other projects like
PHP ADODB and PEAR?

Just another curious guy from far side of the world,
Happy new year :)
--
__________
| |
| | Enver ALTIN (a.k.a. skyblue)
| | Software developer, IT consultant
| FRONT |
|==========| FrontSITE Bilgi Teknolojisi A.Þ.
|_____SITE_| http://www.frontsite.com.tr/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQA/9V2GZCB2FZvqK0s RAulPAJ4+e4kcih KiUMlf0M+1OOa8F 57lvQCghIud
PNgQaQ8WHY83eTK r4kLLNO8=
=2Ozb
-----END PGP SIGNATURE-----

Nov 12 '05 #2
Enver ALTIN wrote:
Hi,

On Fri, 2004-01-02 at 13:38, Chris Travers wrote:
A few years ago, I set about porting a PHP application from MySQL to
PostgreSQL, after realizing that MySQL wasn't going to be able to handle it.
In order to do this, I built a light, fast database abstraction layer which
conforms to the behavior of the MySQL functions in PHP. This means that a
large amount of porting work could be made simple using this porting layer
if the application was originally used PHP's native MySQL functions rather
than a standard porting layer. The application was originally released
under the GPL.

I guess it might bother you when people ask this but, what made you do
the hardwork while it's already been done by several other projects like
PHP ADODB and PEAR?

Are those two LIGHT weight?

Afaik, PEAR (DB) affects the performance of your OO-php-app quite bad,
but I haven't really tested it very often myself, just seen tests by others?
And I'm not talking "quite bad, because php is not very fast in OO", I'm
talking "quite bad, compared to other (custom built, light weight,
simple) OO abstraction layers".

Maybe that has changed since then? But I have, for that reason, never
really started using PEAR...

Best regards,

Arjen

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #3
Hi,

On Fri, 2004-01-02 at 14:20, Arjen van der Meijden wrote:
Are those two LIGHT weight?
Afaik, PEAR (DB) affects the performance of your OO-php-app quite bad,
but I haven't really tested it very often myself, just seen tests by others?
And I'm not talking "quite bad, because php is not very fast in OO", I'm
talking "quite bad, compared to other (custom built, light weight,
simple) OO abstraction layers".
Maybe that has changed since then? But I have, for that reason, never
really started using PEAR...


Please don't get me wrong, I've got an obsession like determining the
idea behind any free software project which I'm not really sure if it's
a good thing or not.

I'm not the only one who thinks there are way too many projects
duplicating each other (either completely or partially); wasting human
resources and motivation in both short and long term.

Just talking about PEAR::DB, you know, it's a generic database
abstraction layer which attempts to provide almost the same interface
for hopefully all databases supported by PHP; not only for PostgreSQL
and MySQL. It's no junk and it's something barely standardized and it's
bundled with official PHP distribution. In the end, it's free software.
I have noticed no performance bottlenecks in the past and even if there
was, I doubt there is a starving need for performance in web
applications. And I could be a good salesman so I'd better shut up :)

The term "lightweigh t" means barely nothing to me. Mozilla is FAT, but
most of us do use (at least parts of) it. PostgreSQL is not that
lightweight, you could use flat-files and POSIX API. For many cases,
weight is affordable, and we could possibly help it lose that fat by bug
reports.

BTW, you have not posted a URL for your work. Could you please do so, if
there is any? I would like to take a quick look at your code some time
this weekend.

Thanks for your patience for reading through the
stripped-from-good-ideas proven long text written by me.
Happy new year,
--
__________
| |
| | Enver ALTIN (a.k.a. skyblue)
| | Software developer, IT consultant
| FRONT |
|==========| FrontSITE Bilgi Teknolojisi A.Þ.
|_____SITE_| http://www.frontsite.com.tr/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQA/9WZ+ZCB2FZvqK0s RAp29AJ4hgqs8lI 2JCCyjY2q6K/xgfnWkaACfYgeD
wpV2Tt1wtb8DU3w YXHHwJro=
=xeGU
-----END PGP SIGNATURE-----

Nov 12 '05 #4
Actually, I already had a few thousand lines of code done (using PHP's MySQL
functions) and I needed an abstraction layer to conform to my existing code.

In this case, if an application has been written with PHP's MySQL functions,
porting it to this layer would be simple and straightforward , with a minimum
of rewriting code (aside from, perhaps checking a few queries). Most of it
could be handled with search/replace facilities.

Even with a standard abstraction layer like PEAR or ADODB, the query syntax
is not identical between database managers. Although this is not nearly
perfect, I have attempted abstract over many of these differences (LIMIT
clauses, timestamp formats, etc.) The abstraction is not perfect but it
helps. A few additional functions could be written to better abstract some
of these things.

Basically these files contain a set of light-weight wrappers to facilitate
porting frim MySQL to PostgreSQL of PHP applications.

Basically, incompatibility comes from three things:
1: Incompatible data representation (aside from timestamps not handled by
most abstraction layers, including this one). However, some of these could
be better handled (such as BOOLs).

2: Incompatible function behavior (normally handled by any abstraction
layer)
For example PostgreSQL's return sets are not forward only, while MySQL's
are.

3: Query differences. For example, if I write:
SELECT * FROM customers ORDER BY last_name LIMIT 30 OFFSET 30
This will run on MySQL, but not PostgreSQL. I handled the difference in my
project by adding a function to generate limit clauses for given offsets and
limits. For RDBMS's that don't support offsets (MSSQL, Firebird), this
would be a bit more complex, but it could be done.

In other words, this is a simple API wrapper to make the db's behave the
same. It is NOT OO.

Best Wishes,
Chris Travers

----- Original Message -----
From: "Arjen van der Meijden" <ac********@vul canus.its.tudel ft.nl>
To: "Enver ALTIN" <en*********@fr ontsite.com.tr>
Cc: "Chris Travers" <ch***@travelam ericas.com>;
<pg***********@ postgresql.org>
Sent: Friday, January 02, 2004 7:20 PM
Subject: Re: [GENERAL] Help with PostgreSQL porting project

Enver ALTIN wrote:
Hi,

On Fri, 2004-01-02 at 13:38, Chris Travers wrote:
A few years ago, I set about porting a PHP application from MySQL to
PostgreSQL, after realizing that MySQL wasn't going to be able to handle it.In order to do this, I built a light, fast database abstraction layer whichconforms to the behavior of the MySQL functions in PHP. This means that alarge amount of porting work could be made simple using this porting layerif the application was originally used PHP's native MySQL functions ratherthan a standard porting layer. The application was originally released
under the GPL.

I guess it might bother you when people ask this but, what made you do
the hardwork while it's already been done by several other projects like
PHP ADODB and PEAR?

Are those two LIGHT weight?

Afaik, PEAR (DB) affects the performance of your OO-php-app quite bad,
but I haven't really tested it very often myself, just seen tests by

others? And I'm not talking "quite bad, because php is not very fast in OO", I'm
talking "quite bad, compared to other (custom built, light weight,
simple) OO abstraction layers".

Maybe that has changed since then? But I have, for that reason, never
really started using PEAR...

Best regards,

Arjen


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2598
by: Savage | last post by:
I have a PostgreSQL database running under linux. Unfortunately the company has deemed it neccessary to move from Linux to Windows, so now I am tasked with moving all of the PostgreSQL database tables and stored procedures over to MSDE. The data itself can easily be recreated. The main problem is porting the structure of the existing DB over. I've never done this before, and don't have any ideas where to even start. Has anyone got any...
28
2480
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as follows: 1. Develop the project code on XP.
10
3258
by: Rada Chirkova | last post by:
Hi, at NC State University, my students and I are working on a project called "self-organizing databases," please see description below. I would like to use an open-source database system for implementation and would really appreciate your opinion on whether PostgreSQL is suitable for the project. In general, I am very impressed by the quality of PostgreSQL code and documentation, as well as by the support of the developer community. ...
20
1509
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either a MySql shop or a Postgresql shop. It's my opinion that we should be using PG, because of the full ACID support, and the license involved. A consultant my company hired before bringing me in is pushing hard for MySql, citing speed and community...
11
2946
by: Errol Neal | last post by:
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,
3
2151
by: Rod Early | last post by:
I have the task of converting a SQL Server 2000 database to PostgreSQL. The data itself does not need to be converted, but the structure and stored procedures must be. I expect that converting tables and views will be simple. I expect that converting stored procedures and user-defined functions from T-SQL to PostgreSQL will be more complex. In any case, I am looking for recommendations and counsel regarding my expectations. I have...
2
13791
by: Nadeem Bitar | last post by:
I've searched unsuccessfully on google and the archives for a technical comparison of Oracle and PostgreSQL. Is there any free and recent comparison that covers more than just the basic differences. Thanks, Nadeem -----BEGIN PGP SIGNATURE-----
5
3273
by: BK-Chicago | last post by:
I am in the midst of porting a massive MFC application from VS6.0 to VS8.0. While i have fixed most of the compile time errors, i do have quite a linker error that i have not been able to resolve. The error i get is Error 100 error LNK2001: unresolved external symbol "public: virtual void __thiscall CWnd::PostNcDestroy(void)" (?PostNcDestroy@CWnd@@UAEXXZ) Evenout.obj I have about 200 of these on almost all the obj's that have a dialog...
7
1874
by: Penelope Dramas | last post by:
Hello, We have decided to change our database back-end from MSDE to postgreSQL. Would anyone please share his/her experience with this database as far as speed, functionality and security concerns. Thanks,
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.