PostgrreSQL & MySQL lazarus / 16-Databases ---------------------------------------------------------------------- thaimann · 2010-04-15 23:17 Ok, Lazarus currently doesn't work with MySQL 5.1+ and the lead programmers for Lazarus say MySQL is a pain to work with, but what about PostgreSQL?  I have an app that is written to use MySQL, on my desktop and I made a basic attempt to convert it to use PostgreSQL.  My Desktop is running FC10 with what appears to be MySQL 5.0.88 and PostgreSQL 8.3.8-2.  Now I tryed to run this app on my laptop which has FC12 and it fails with "Can not load PosgreSQL Client (libpq.so).  Is it installed."  It is.  FC12 has MySQL 5.1.42-7 and Postgre 8.4.3-1. When I run a locate on libpq.so I get Laptop: /usr/lib/libpq.so /usr/lib/libpq.so.5.2 Desktop /usr/lib/libpq.so /usr/lib/libpq.so.5 /usr/lib/libpq.so.5.1 /usr/lib64/libpq.so /usr/lib64/libpq.so.5 /usr/lib64/libpq.so.5.1 How is it a Open Source Compiler doesn't work with the two most popular Open Source Databases?  I am assuming most of this will be corrected when Lazarus 0.9.29 is released in a stable format, when will this occur? ---------------------------------------------------------------------- vfclists · 2010-04-15 23:27 What components are you using? What versions of Lazarus and FreePascal? I am not familiar with using Lazarus on Linux, but you should give more info about your setup if you need help. ---------------------------------------------------------------------- Troodon · 2010-04-16 01:24 Both MySQL and PostgreSQL work fine with Lazarus/FPC using ZeosLib. I have not tried on Linux yet but on Windows you need to make sure the bin folders for each of the RDBMS are appended to the system PATH variable and then reboot. On Linux make sure the directory where your .so libs are located is in /etc/ld.so.conf then run ldconfig; also, check the value of your $PATH variable and make sure it includes the bin directory for the executables installed by MySQL and PostgreSQL. However, when you say something is not working as expected it would help if you provided a simple example to demonstrate the issue. ---------------------------------------------------------------------- thaimann · 2010-04-16 20:02 Lazarus:  0.9.28.2-0.i586 fpc:         2.2.4-4.fc12.2.i686 Components Used:     TPQConnection     TSQLTransaction     TSQLQuery     TDataSource ps I am tired of hearing about Zeoslib.  Last I checked, it wouldn't compile with out some work.  And I doubt very much that someone looking for an Astronomy Planning Program is going to want to try to get their compiler to work. They will want it to work out of the box.  I am going to have a lot of trouble just convincing them to compile in the first place.  I also doubt if I can convince them if they are running the most up to date Linux and my program won't connect to their server.  I prefer working with MySQL, since it is easier for the novice, but I was going to produce a Postgre version since Lazarus hasn't been able to connect to the latest MySQL Server for months. ---------------------------------------------------------------------- cpalx · 2010-04-16 21:18 I work with lazarus and postgreSQL in windows and linux and goes fine, i use ZeosLib. maybe you have problems if you dont install libpq and libpq-dev, try to install them and try later. Lazarus rocks... ---------------------------------------------------------------------- cpalx · 2010-04-17 01:08 Even if you work with PQconecction, you need libpq and lipq-dev. Install them and you will see. Remember to configure your postgres server .... By default just listen localhost with ssl protocol ---------------------------------------------------------------------- Zoran · 2010-04-17 03:46 Quote from: thaimann on April 16, 2010, 10:02:32 pmps I am tired of hearing about Zeoslib.  Last I checked, it wouldn't compile with out some work. It would compile without some work: If you use Lazarus 0.9.28.2 with fpc 2.2.4, Zeos 6.6.5 compiles. If you use Lazarus 0.9.29 with 2.4.0, Zeos 6.6.6 compiles. That's all. ---------------------------------------------------------------------- thaimann · 2010-04-17 14:33 Ok, in the yum repository I did a search for anything with libpq and got the following: yum list | grep libpq libpqxx.i686                  1.2.6.8-15.fc12                         @fedora libpqxx.devel.i686        1.2.6.8-15.fc12                         fedora I then tryed to install both, the first one said it was installed, but ran an update. The 2nd gave me a "No Package Available" error. Searching on libpqxx and yum gave me the following info: >>Author: >>    Jeroen T. Vermeulen >>Welcome to libpqxx, the C++ API to the PostgreSQL database management system. >>Compiling this package requires PostgreSQL to be installed-- including the C headers for client >>development. The library builds on top of PostgreSQL's standard C API, libpq. The libpq headers >>are not needed to compile client programs, however. >>For a quick introduction to installing and using libpqxx, see the README file; a more extensive >>tutorial is available in doc/html/Tutorial/index.html. >>The latest information, as well as updates, a mailing list, and a bug reporting system can be >>found at the project's home page. So I am saying I have the libraries.  A recompile and retest gave me the same errors. And as I have said before quit bugging me about Zeoslib.  I am not using it until it comes as part of the  Lazarus System.  I am not going to walk my users through configuration Hell.  The way I had it before on MySQL compiled and worked on any OS (Linux & Windows) as long as the user had MySQL 5.0.n  Only the most technically savvy user is even going to get Postgre configured and now you want them to jump through how many hoops getting an addon to a compiler installed.   And there are too many variants to Linux to give them a binary.  I can't compile on Fedora and have the binary run on Ubuntu or whatever. I am a Linux user who is willing to compile an app on my system,  but even I have a limit of how many hoops I will jump through.  I have given up on apps that didn't compile and work after a couple of hours of work. ---------------------------------------------------------------------- vfclists · 2010-04-17 21:25 Quote from: thaimann on April 17, 2010, 04:33:18 pmI am a Linux user who is willing to compile an app on my system,  but even I have a limit of how many hoops I will jump through.  I have given up on apps that didn't compile and work after a couple of hours of work. Perhaps a couple of hours is not long enough Given the frame of mind you are exhibiting you are unlikely to arrive at a solution, when a solution probably exists. You haven't even show the error messages being output for someone who understands them to help you. There is a solution, just be methodical, ask around to see what steps you can take to diagnose the problem and report your findings. One of the shortcomings I see here is that people or not pointed what steps to take in order to give more information about compilation and installation problems. Development systems often come with logging facilities to help trace problems. Learn them and use them. ---------------------------------------------------------------------- thaimann · 2010-04-18 17:09 And your type of thinking is what sends your average user running and screaming back to Windows and Proprietary software.  When there was a working program and the user updates his or her software to the current version because what they had is no longer supported and then  a key piece of software no longer works with the new software.  And then instead of just being able to update their software through the usual repositories they have to jump through hoop after hoop after hoop after hoop ... until they can get their software to work.  To the Lazarus Team I say, The Current version of MySQL and PostgreSQL (But expecially MySQL) needs supported out of the box.  No Ifs ands or buts.  What is happening now is a guarantee for failure and obscurity.  At a minimum when a new version of MySQL hits the streets and it requires new components, those components should be released ASAP!!! And not in the next version, but as a simple script to the latest stable version.  No one cares that you don't like MySQL, it is the STANDARD and if your software won't work with the standard they will find something else that will and does work.  Guess what?  I have a copy of Delphi 7 here and MySQLDAC.  Even though it is years old, I can get it to work with MySQL on my laptop (under Wine) and with a lot less effort. Also, I should point out, your average user doesn't want to compile programs or spend much time configuring software.  They expect it to work out of the box.  And if you can't sell Open Source to the average user you are dead in the water, because geeks aren't the majority.  And it will be the majority of users who ultimately decide if Open Source survives or ends up on the trash heap of history!!! ---------------------------------------------------------------------- JD · 2010-04-19 06:51 Quote from: thaimann on April 18, 2010, 07:09:55 pmAnd your type of thinking is what sends your average user running and screaming back to Windows and Proprietary software.  When there was a working program and the user updates his or her software to the current version because what they had is no longer supported and then  a key piece of software no longer works with the new software.  And then instead of just being able to update their software through the usual repositories they have to jump through hoop after hoop after hoop after hoop ... until they can get their software to work.  To the Lazarus Team I say, The Current version of MySQL and PostgreSQL (But expecially MySQL) needs supported out of the box.  No Ifs ands or buts.  What is happening now is a guarantee for failure and obscurity.  At a minimum when a new version of MySQL hits the streets and it requires new components, those components should be released ASAP!!! And not in the next version, but as a simple script to the latest stable version.  No one cares that you don't like MySQL, it is the STANDARD and if your software won't work with the standard they will find something else that will and does work.  Guess what?  I have a copy of Delphi 7 here and MySQLDAC.  Even though it is years old, I can get it to work with MySQL on my laptop (under Wine) and with a lot less effort. Also, I should point out, your average user doesn't want to compile programs or spend much time configuring software.  They expect it to work out of the box.  And if you can't sell Open Source to the average user you are dead in the water, because geeks aren't the majority.  And it will be the majority of users who ultimately decide if Open Source survives or ends up on the trash heap of history!!! You have a point. End users can be very unforgiving. But honestly, I would advise that you try ZeosLib again following the tips Zoran gave you. It is well worth the effort. Lazarus is a work in progress. Give it time. I'm eagerly waiting for Lazarus to get to the level of Delphi 7 Professional/Enterprise. But it will get there, give it time. ---------------------------------------------------------------------- thaimann · 2010-04-19 10:39 I probably will try it again, but I am not happy about it.   Because here is the deal.  My programs niche will be the Linux User.  The Windows and Mac OS's have plenty of software to chose from.  Now everything I do to my compiler, the user will have to do also.  They will just go out, buy a copy of the latest & Greatest Windows app and just run it under wine.  It's just easier and no one cares about efficiency any more.  There are too many variants of Linux for me with minimal resources to produce a binary file for each Linux Distribution. Terry ---------------------------------------------------------------------- Troodon · 2010-04-19 13:40 Terry, my advice re Linux would be to focus on Ubuntu only. It's supported by Canonical yet it's free and has many fans. In my experience the Qt widgetset is faster than GTK2 for Lazarus applications. On a more general note, a reasonably good approach with Lazarus/FPC is to stick to the current version (not the development one, despite its more advanced features), get a daily build that works for you, and then do not update unless it's really necessary. ---------------------------------------------------------------------- Zoran · 2010-04-19 14:28 Quote from: thaimann on April 19, 2010, 12:39:17 pmNow everything I do to my compiler, the user will have to do also.  I don't understand what will installing of ZEOS in your Lazarus IDE have to do with your end user? ---------------------------------------------------------------------- cpalx · 2010-04-20 01:37 Please, install libpq and libpq-dev thats all you need. remember configure your database server (postgresql)... by default you can not get access. It is so fast all