Saturday, 2011-07-02

*** cytrinox_ has joined #ingres00:38
*** cytrinox has quit IRC00:41
*** cytrinox_ is now known as cytrinox00:41
*** Alex| has joined #ingres02:06
*** ChanServ sets mode: +o Alex|02:06
*** Alex| has quit IRC03:28
*** Mud has joined #ingres04:29
*** Mud has quit IRC05:19
*** Dejan has joined #ingres07:45
Dejanhello07:47
*** Alex| has joined #ingres07:55
*** ChanServ sets mode: +o Alex|07:55
*** Alex| has quit IRC09:34
*** sehh has joined #ingres10:20
sehhhey people10:20
sehhI'm converting a PHP app to use Ingres instead of MySQL. This application is heavily dependent on the mysql_insert_id() function which doesn't exist in Ingres. How can I simulate it under Ingres?10:21
Vroomfondlehttp://community.ingres.com/wiki/Using_Ingres_Identity_Columns#The_last_identity.28.29_function10:27
Vroomfondlethe driver doesn't support it directly AFAIK so I think you'll have to just tag on an extra SQL statement using that function ^^10:28
sehhthanks man, I'll check it out10:40
Dejansehh, it does exist10:45
Dejanif you have latest ingres version10:45
Dejanfrom 9.3 on10:45
Dejani do not know if 9.2 has identity fields10:45
sehhI'm check it right now, unfortunately I was given an already-made database so I'm not sure which version it is10:47
sehhthis is a major issue for me, since there are several thousand queries that use this function10:48
sehhversion is: II 9.4.0 (int.lnx/102)NPTL10:48
sehhso I guess the LAST_IDENTITY() function should exist10:49
Dejan9.4 ?10:49
Dejannever heard of that version :D10:50
DejanI did not know it was released10:50
Dejanyep, it should10:50
Dejanbe careful with it though - you need to call it inside the transaction10:51
Dejani think ingres enforces that10:51
Dejanso you get proper ID10:51
sehhoh that could be an issue10:52
Dejanyep :D10:52
sehhso let me get this straight... for every single query that I run, I have to "commit" at the end?10:52
Dejannope10:53
sehherm..10:53
sehhthe ingres documentation is very... lacking. From what I understood, if I don't "commit" then changes will never be saved (unless autocommit is enabled)10:54
sehhor did I get this wrong?10:54
Dejanthat is how it should be10:54
Dejan:)10:54
Dejanyou can make ingres behave like mysql10:54
Dejanmysql uses read_commited isolation level10:55
Dejani think10:55
sehhhmm I don't want to change the server setup, so I'll have to do this at the application level10:55
sehh(the database is being used at the same time by an older application)10:55
sehhso for all UPDATE and INSERT queries, I have to run ingres_commit() at the end of the query10:56
Dejanyou can also setup isolation for your session10:56
sehhhow would I do that please?10:56
Dejannot for all10:56
Dejanyou do not have to do that for all10:57
Dejanyou have two options - setup autocommit10:57
Dejanand behave like with mysql10:57
Dejanor you dont10:57
sehhoh10:57
Dejanbut then you have to commit when it makes sense to commit10:57
sehhthats easy, the PHP driver supports autocommit10:57
Dejanyep10:57
Dejan:)10:57
Dejanautocommit is okay in some cases10:57
Dejandepends on the application, really10:58
Dejanbut sometimes you want a group of statements to either successfully work together, or if not, rollback10:58
sehhwell, I am forced to do this, because I can't make major changes to the PHP application, I'm only creating an Object to support Ingres underneath, I can't change the PHP application itself10:58
Dejanwith autocommit you cant do that10:58
Dejanthen setup autocommit10:59
sehhwell, the good thing is, this PHP application doesn't have group statements that need this functionality10:59
Dejanand work as with mysql10:59
sehhbut won't autocommit mess with LAST_IDENTITY() ?10:59
Dejantry and see11:00
Dejanit is possible, yep11:00
Dejani never use last_identity() from php...11:01
Dejani am mostly in java world here...11:01
Dejan:/11:01
sehhok I'll give it a try and see11:01
sehhthank you for your help, much appreciated11:01
Dejanyeah, that is the best way to see11:01
Dejanyou're welcome11:01
Dejanthat is why we have this channel :)11:01
Dejani need to eat something... bbl11:01
sehhdamn11:12
sehhlast_identity() doesn't exist in my version of ingres11:12
*** Alex| has joined #ingres11:14
*** ChanServ sets mode: +o Alex|11:14
sehhhmm weird11:16
sehh9.4 doesn't exist as an ingres version11:16
sehhmaybe what I was give is an older version that has been heavily modified/patched11:16
sehhsince the last_identity() function exists in 9.3, I guess its an even older version11:17
DejanI am back11:27
Dejani just came from the grocery shop :D11:27
Dejanwell, 9.4 is a test release11:27
Dejanif i remember well11:28
Dejanif you ask me, use 10.011:28
Dejani use 10.0 in production11:28
Dejani migrated like the first week GA version was out ;)11:28
sehhwell, I'll suggest that to my friend, but unfortunately I'm not in control of the database11:48
sehhI'm just the guy who is converting the PHP application to use Ingres11:49
Dejan9.4 should have identity fields...11:49
*** Alex| has quit IRC11:50
*** Alex| has joined #ingres11:51
*** ChanServ sets mode: +o Alex|11:51
sehhwell, I tried the function and got:11:51
sehhE_US0B5A line 1, There is no such function as 'last_identity'.11:51
*** Alex| has quit IRC11:52
*** Alex| has joined #ingres11:52
*** ChanServ sets mode: +o Alex|11:52
Dejan:(12:06
Dejanthe only way to "emulate" the last_insert_id() is to immediately after insert execute a select with parameters you provided and find what was the ID Ingres gave to that row...12:07
sehhthe thing is, the mysql version doesn't take any parameters12:08
Dejanbut I guess you will not have zillion inserts anyway, so it is not a big deal12:08
sehhso the last insert, on ANY table, works fine12:08
Dejanno, i was talking about parameters to the INSERT statement12:08
sehhhere, I have to get the parameters, the table that the row was inserted into and run a select statement12:08
Dejanthe emulation is like:12:08
sehherm yes thats what I mean, I have to convert the INSERT into a SELECT12:09
Dejan1) execute: INSERT INTO <table_name>(params without ID) VALUES(parameters here)12:09
Dejan2) SELECT FROM <table_name> WHERE <parameters equal to what you have just inserted>12:09
Dejan3) get the ID INGRES gave to it12:10
Dejanthat will do for now12:10
Dejanuntil you migrate to Ingres 1012:10
sehhindeed :(12:10
Dejanno sad face12:11
Dejanif you do not do zillion inserts it is going to be fast like hell12:11
Dejantrust me, Ingres optimizer is state of art12:11
Dejanit is far better than MySQL's12:11
Dejanor MariaDB's12:11
DejanI actally did not have time to benchmark Ingres 10 vs MariaDB12:12
DejanI will do that one day...12:12
Dejan(I use MariaDB, not MySQL)12:12
Dejan(when I need MySQL)12:12
sehhwell, to tell the truth, sad part is that I have been working on this conversion for a few weeks and it has been a horrible time for me. Ingres is so bad to the administrator/developer, I can't even describe it. I had problems connecting PHP to Ingres, then problems connecting the Web server to the DB server (because Ingres requires a copy at the client), then I had character set problems, now I have query problems, and the whole time I had prob12:14
sehhlems with my terminal/ssh and TERM types and function keys compatibility and bad shell utilities. MY GOD this database has been VERY BADLY IMPEMENTED! and I haven't even used it as a database yet...  :( sad indeed12:14
sehhnot to mention that documentation is really really bad, it just states the obvious, without any further explanation. Like: "this is the connection ID".... errm? yeah like that helps me at all...12:15
Dejanayayay!12:17
DejanI use MySQL since '96 almost12:17
Dejanand trust me when I say that Ingres is MUCH MUCH better for DBA then MySQL will EVER be!12:17
*** DerMeister has joined #ingres12:18
Dejanapart from MAN pages12:18
DejanMySQL has MAN pages12:18
DejanIngres does not12:18
DejanI complained about it at the UK IUA Conference 201112:18
Dejan( http://uk-iua.org.uk )12:18
Dejanactually http://iua.org.uk/ works as well12:19
Dejanin general, Ingres docs suck12:19
Dejanincluding the official docs12:20
Dejanthey are comprehensive, but not enough12:20
DejanIngers distribution has many pieces12:20
Dejanthat do not have counterparts in MySQL12:20
Dejanso it is easier for MySQL people to build good documentation12:20
DejanIngres has (what MySQL does not) :12:21
Dejan - Star server12:21
Dejan  - GCN12:21
Dejan - ABF12:21
Dejan - Vision12:21
Dejan - various console tools like accessdb, cbf, accesdb, qbf, isql, etc12:22
Dejan  they are big enough for large documents, each of them12:22
Dejan  ABF is terribly underrated, it is simply AMAZING piece of software12:23
Dejani strongly recommend you to take a look12:23
Dejanan example (recent)12:23
Dejanwe needed fast some test values12:23
Dejanin ~20 new tables12:23
Dejanin a large database12:23
Dejanso, instead of using typical sql client12:24
Dejanwhich does tabular data inputs12:24
Dejanwe decided to quickly generate forms using ABF12:24
Dejanactually, we used Vision12:24
Dejanin an hour we had an application12:24
Dejanwhich was pretty user-friendly12:24
sehhhmm12:24
Dejanwhich we used to populate these 20 new tables12:24
Dejanwith ACTUAL data12:25
DejanABF and Forms have some amazing automatic features12:25
Dejanso one can build a database-driven application very, very fast12:25
DejanABF was one of the reasons why I fell in love with Ingres12:25
Dejanplus the recovery server12:26
Dejan:D12:26
DejanI am taking care of ~40 Ingres databases, and whenever something crashed stopped working etc, Ingres recovered without any problems12:26
Dejanwith MySQL that is, I believe, impossible12:27
DejanI have seen MySQL fail miserably quite often12:27
sehhI see...12:27
sehhwell12:27
DejanI know a bank in Italy which does not make backups12:28
Dejanthey use Ingres, and they trust it that much12:28
sehhI'm not building a database or even forms or tables12:28
sehhso the above tools are useless to me12:28
Dejani touched this topic because of documentation12:28
sehhall I'm doing is create a PHP object to seamlessly make a PHP application run over Ingres instead of MySQL12:28
Dejana proper Ingres documentation would be at least 5x larger than MySQL documentation12:28
Dejanbecause of all i mentioned above12:29
sehhhmm12:29
sehhwell the docs are REALLY bad, so they are completely useless12:29
Dejanthat was the purpose of all this bubbling12:29
Dejannot really useless, but terribly outdated12:29
Dejanand again, i am pissed off because there are no man pages12:29
Dejanffs, on UNIX man pages are a must!12:29
Dejani cant live without man pages!12:29
Dejan:D12:29
sehhnot only man pages, but the unix utils have no commandline help (eg, "ls --help" or something)12:30
Dejanwhen I asked for man pages, Bill asked me "do you expect an iPad user to use man pages?"12:30
sehhnot to mention the whole mess with terminals and character sets... really outdated12:30
sehhwhat a stupid answer...12:31
Dejani could not answer, because that rendered me speechless12:31
Dejana person who decides future of Ingres said that12:31
Dejanok, hands down, he was joking some people told me12:32
Dejanit is possible he was joking12:32
Dejanbut he seemed terribly serious12:32
sehhwell... I took me several days and finnaly someone in this channel (Vroomfondle) told me that the PHP driver doesn't directly connect to an Ingres DB server, instead I must have a local Ingres do that. It would be nice if the docs explained this quirky process that nobody else is using.12:32
Dejanalso when I asked about PHP driver, and support of the development, they answered "if there is demand for it, we will hire someone again"12:33
sehhso the docs are really lacking...12:33
DejanI was SO PISSED OFF when they sacked Grant12:33
sehhwell, PHP is the driving force of web development in the WORLD of internet, so I am not sure what kind of "demand" they expect...12:33
sehhoh..12:33
Dejannot really12:33
DejanPHP is stagnating12:34
Dejanit was very popular few years ago, but now some new technologies are becomming more popular12:34
sehhwell, I don't know about PHP as a language, but I don't see anything other than PHP being used for web development12:34
Dejanstill, stopping the support for the "dynamic languages" as I called them on the UK IUA conference is bordering with idiocy12:35
Dejan(because I asked about "dynamic languages" support)12:35
Dejanthe only dynamic language I use is PHP12:36
Dejanbut some other people use Python, Ruby, PERL12:36
Dejansehh, Java and .NET are more popular now, I believe12:36
Dejanfor web development12:36
Dejanfor several valid reasons12:37
sehhwell, not where I work or with the businesses I'm related to. Everything is PHP for web development12:37
DejanI do PHP development since '9612:38
Dejanit was nice long ago12:38
sehhjava is too heavy and slow for websites with too many visitors and .NET is by Microsoft so nobody wants to deal with that.12:38
Dejannow Java and .NET are better solutions for medium-to-large websites12:38
DejanPHP is okay for small website12:39
sehhhmm12:39
Dejansome Drupal website etc12:39
DejanJava, believe it or not, is much faster solution than PHP12:39
Dejaneven with default configuration :)12:39
Dejanout-of-box Jboss with a typical web app is waaaay faster than php12:40
Dejannot to mention scalability12:40
Dejanbut we are off-topic here12:40
Dejanone hint: php is an interpreted language12:40
DerMeisterAnother off-topic question: Is anyone in this channel an Ingres employee?12:42
Dejanaross is12:42
Dejanthey hired him back12:42
Dejanso he can continue with Geospatial12:42
Dejan(thank God)12:42
Dejanderylm is also working for Ingres12:43
Dejani do not know if atrofast is working for ingres again or not12:43
*** DerMeister has quit IRC13:05
*** DerMeister has joined #ingres13:06
*** DerMeister has quit IRC13:52
*** Dejan has quit IRC14:03
*** Alex| has quit IRC18:07

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!