*** cytrinox_ has joined #ingres | 00:38 | |
*** cytrinox has quit IRC | 00:41 | |
*** cytrinox_ is now known as cytrinox | 00:41 | |
*** Alex| has joined #ingres | 02:06 | |
*** ChanServ sets mode: +o Alex| | 02:06 | |
*** Alex| has quit IRC | 03:28 | |
*** Mud has joined #ingres | 04:29 | |
*** Mud has quit IRC | 05:19 | |
*** Dejan has joined #ingres | 07:45 | |
Dejan | hello | 07:47 |
---|---|---|
*** Alex| has joined #ingres | 07:55 | |
*** ChanServ sets mode: +o Alex| | 07:55 | |
*** Alex| has quit IRC | 09:34 | |
*** sehh has joined #ingres | 10:20 | |
sehh | hey people | 10:20 |
sehh | I'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 |
Vroomfondle | http://community.ingres.com/wiki/Using_Ingres_Identity_Columns#The_last_identity.28.29_function | 10:27 |
Vroomfondle | the 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 |
sehh | thanks man, I'll check it out | 10:40 |
Dejan | sehh, it does exist | 10:45 |
Dejan | if you have latest ingres version | 10:45 |
Dejan | from 9.3 on | 10:45 |
Dejan | i do not know if 9.2 has identity fields | 10:45 |
sehh | I'm check it right now, unfortunately I was given an already-made database so I'm not sure which version it is | 10:47 |
sehh | this is a major issue for me, since there are several thousand queries that use this function | 10:48 |
sehh | version is: II 9.4.0 (int.lnx/102)NPTL | 10:48 |
sehh | so I guess the LAST_IDENTITY() function should exist | 10:49 |
Dejan | 9.4 ? | 10:49 |
Dejan | never heard of that version :D | 10:50 |
Dejan | I did not know it was released | 10:50 |
Dejan | yep, it should | 10:50 |
Dejan | be careful with it though - you need to call it inside the transaction | 10:51 |
Dejan | i think ingres enforces that | 10:51 |
Dejan | so you get proper ID | 10:51 |
sehh | oh that could be an issue | 10:52 |
Dejan | yep :D | 10:52 |
sehh | so let me get this straight... for every single query that I run, I have to "commit" at the end? | 10:52 |
Dejan | nope | 10:53 |
sehh | erm.. | 10:53 |
sehh | the 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 |
sehh | or did I get this wrong? | 10:54 |
Dejan | that is how it should be | 10:54 |
Dejan | :) | 10:54 |
Dejan | you can make ingres behave like mysql | 10:54 |
Dejan | mysql uses read_commited isolation level | 10:55 |
Dejan | i think | 10:55 |
sehh | hmm I don't want to change the server setup, so I'll have to do this at the application level | 10:55 |
sehh | (the database is being used at the same time by an older application) | 10:55 |
sehh | so for all UPDATE and INSERT queries, I have to run ingres_commit() at the end of the query | 10:56 |
Dejan | you can also setup isolation for your session | 10:56 |
sehh | how would I do that please? | 10:56 |
Dejan | not for all | 10:56 |
Dejan | you do not have to do that for all | 10:57 |
Dejan | you have two options - setup autocommit | 10:57 |
Dejan | and behave like with mysql | 10:57 |
Dejan | or you dont | 10:57 |
sehh | oh | 10:57 |
Dejan | but then you have to commit when it makes sense to commit | 10:57 |
sehh | thats easy, the PHP driver supports autocommit | 10:57 |
Dejan | yep | 10:57 |
Dejan | :) | 10:57 |
Dejan | autocommit is okay in some cases | 10:57 |
Dejan | depends on the application, really | 10:58 |
Dejan | but sometimes you want a group of statements to either successfully work together, or if not, rollback | 10:58 |
sehh | well, 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 itself | 10:58 |
Dejan | with autocommit you cant do that | 10:58 |
Dejan | then setup autocommit | 10:59 |
sehh | well, the good thing is, this PHP application doesn't have group statements that need this functionality | 10:59 |
Dejan | and work as with mysql | 10:59 |
sehh | but won't autocommit mess with LAST_IDENTITY() ? | 10:59 |
Dejan | try and see | 11:00 |
Dejan | it is possible, yep | 11:00 |
Dejan | i never use last_identity() from php... | 11:01 |
Dejan | i am mostly in java world here... | 11:01 |
Dejan | :/ | 11:01 |
sehh | ok I'll give it a try and see | 11:01 |
sehh | thank you for your help, much appreciated | 11:01 |
Dejan | yeah, that is the best way to see | 11:01 |
Dejan | you're welcome | 11:01 |
Dejan | that is why we have this channel :) | 11:01 |
Dejan | i need to eat something... bbl | 11:01 |
sehh | damn | 11:12 |
sehh | last_identity() doesn't exist in my version of ingres | 11:12 |
*** Alex| has joined #ingres | 11:14 | |
*** ChanServ sets mode: +o Alex| | 11:14 | |
sehh | hmm weird | 11:16 |
sehh | 9.4 doesn't exist as an ingres version | 11:16 |
sehh | maybe what I was give is an older version that has been heavily modified/patched | 11:16 |
sehh | since the last_identity() function exists in 9.3, I guess its an even older version | 11:17 |
Dejan | I am back | 11:27 |
Dejan | i just came from the grocery shop :D | 11:27 |
Dejan | well, 9.4 is a test release | 11:27 |
Dejan | if i remember well | 11:28 |
Dejan | if you ask me, use 10.0 | 11:28 |
Dejan | i use 10.0 in production | 11:28 |
Dejan | i migrated like the first week GA version was out ;) | 11:28 |
sehh | well, I'll suggest that to my friend, but unfortunately I'm not in control of the database | 11:48 |
sehh | I'm just the guy who is converting the PHP application to use Ingres | 11:49 |
Dejan | 9.4 should have identity fields... | 11:49 |
*** Alex| has quit IRC | 11:50 | |
*** Alex| has joined #ingres | 11:51 | |
*** ChanServ sets mode: +o Alex| | 11:51 | |
sehh | well, I tried the function and got: | 11:51 |
sehh | E_US0B5A line 1, There is no such function as 'last_identity'. | 11:51 |
*** Alex| has quit IRC | 11:52 | |
*** Alex| has joined #ingres | 11:52 | |
*** ChanServ sets mode: +o Alex| | 11:52 | |
Dejan | :( | 12:06 |
Dejan | the 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 |
sehh | the thing is, the mysql version doesn't take any parameters | 12:08 |
Dejan | but I guess you will not have zillion inserts anyway, so it is not a big deal | 12:08 |
sehh | so the last insert, on ANY table, works fine | 12:08 |
Dejan | no, i was talking about parameters to the INSERT statement | 12:08 |
sehh | here, I have to get the parameters, the table that the row was inserted into and run a select statement | 12:08 |
Dejan | the emulation is like: | 12:08 |
sehh | erm yes thats what I mean, I have to convert the INSERT into a SELECT | 12:09 |
Dejan | 1) execute: INSERT INTO <table_name>(params without ID) VALUES(parameters here) | 12:09 |
Dejan | 2) SELECT FROM <table_name> WHERE <parameters equal to what you have just inserted> | 12:09 |
Dejan | 3) get the ID INGRES gave to it | 12:10 |
Dejan | that will do for now | 12:10 |
Dejan | until you migrate to Ingres 10 | 12:10 |
sehh | indeed :( | 12:10 |
Dejan | no sad face | 12:11 |
Dejan | if you do not do zillion inserts it is going to be fast like hell | 12:11 |
Dejan | trust me, Ingres optimizer is state of art | 12:11 |
Dejan | it is far better than MySQL's | 12:11 |
Dejan | or MariaDB's | 12:11 |
Dejan | I actally did not have time to benchmark Ingres 10 vs MariaDB | 12:12 |
Dejan | I will do that one day... | 12:12 |
Dejan | (I use MariaDB, not MySQL) | 12:12 |
Dejan | (when I need MySQL) | 12:12 |
sehh | well, 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 prob | 12:14 |
sehh | lems 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 indeed | 12:14 |
sehh | not 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 |
Dejan | ayayay! | 12:17 |
Dejan | I use MySQL since '96 almost | 12:17 |
Dejan | and trust me when I say that Ingres is MUCH MUCH better for DBA then MySQL will EVER be! | 12:17 |
*** DerMeister has joined #ingres | 12:18 | |
Dejan | apart from MAN pages | 12:18 |
Dejan | MySQL has MAN pages | 12:18 |
Dejan | Ingres does not | 12:18 |
Dejan | I complained about it at the UK IUA Conference 2011 | 12:18 |
Dejan | ( http://uk-iua.org.uk ) | 12:18 |
Dejan | actually http://iua.org.uk/ works as well | 12:19 |
Dejan | in general, Ingres docs suck | 12:19 |
Dejan | including the official docs | 12:20 |
Dejan | they are comprehensive, but not enough | 12:20 |
Dejan | Ingers distribution has many pieces | 12:20 |
Dejan | that do not have counterparts in MySQL | 12:20 |
Dejan | so it is easier for MySQL people to build good documentation | 12:20 |
Dejan | Ingres has (what MySQL does not) : | 12:21 |
Dejan | - Star server | 12:21 |
Dejan | - GCN | 12:21 |
Dejan | - ABF | 12:21 |
Dejan | - Vision | 12:21 |
Dejan | - various console tools like accessdb, cbf, accesdb, qbf, isql, etc | 12:22 |
Dejan | they are big enough for large documents, each of them | 12:22 |
Dejan | ABF is terribly underrated, it is simply AMAZING piece of software | 12:23 |
Dejan | i strongly recommend you to take a look | 12:23 |
Dejan | an example (recent) | 12:23 |
Dejan | we needed fast some test values | 12:23 |
Dejan | in ~20 new tables | 12:23 |
Dejan | in a large database | 12:23 |
Dejan | so, instead of using typical sql client | 12:24 |
Dejan | which does tabular data inputs | 12:24 |
Dejan | we decided to quickly generate forms using ABF | 12:24 |
Dejan | actually, we used Vision | 12:24 |
Dejan | in an hour we had an application | 12:24 |
Dejan | which was pretty user-friendly | 12:24 |
sehh | hmm | 12:24 |
Dejan | which we used to populate these 20 new tables | 12:24 |
Dejan | with ACTUAL data | 12:25 |
Dejan | ABF and Forms have some amazing automatic features | 12:25 |
Dejan | so one can build a database-driven application very, very fast | 12:25 |
Dejan | ABF was one of the reasons why I fell in love with Ingres | 12:25 |
Dejan | plus the recovery server | 12:26 |
Dejan | :D | 12:26 |
Dejan | I am taking care of ~40 Ingres databases, and whenever something crashed stopped working etc, Ingres recovered without any problems | 12:26 |
Dejan | with MySQL that is, I believe, impossible | 12:27 |
Dejan | I have seen MySQL fail miserably quite often | 12:27 |
sehh | I see... | 12:27 |
sehh | well | 12:27 |
Dejan | I know a bank in Italy which does not make backups | 12:28 |
Dejan | they use Ingres, and they trust it that much | 12:28 |
sehh | I'm not building a database or even forms or tables | 12:28 |
sehh | so the above tools are useless to me | 12:28 |
Dejan | i touched this topic because of documentation | 12:28 |
sehh | all I'm doing is create a PHP object to seamlessly make a PHP application run over Ingres instead of MySQL | 12:28 |
Dejan | a proper Ingres documentation would be at least 5x larger than MySQL documentation | 12:28 |
Dejan | because of all i mentioned above | 12:29 |
sehh | hmm | 12:29 |
sehh | well the docs are REALLY bad, so they are completely useless | 12:29 |
Dejan | that was the purpose of all this bubbling | 12:29 |
Dejan | not really useless, but terribly outdated | 12:29 |
Dejan | and again, i am pissed off because there are no man pages | 12:29 |
Dejan | ffs, on UNIX man pages are a must! | 12:29 |
Dejan | i cant live without man pages! | 12:29 |
Dejan | :D | 12:29 |
sehh | not only man pages, but the unix utils have no commandline help (eg, "ls --help" or something) | 12:30 |
Dejan | when I asked for man pages, Bill asked me "do you expect an iPad user to use man pages?" | 12:30 |
sehh | not to mention the whole mess with terminals and character sets... really outdated | 12:30 |
sehh | what a stupid answer... | 12:31 |
Dejan | i could not answer, because that rendered me speechless | 12:31 |
Dejan | a person who decides future of Ingres said that | 12:31 |
Dejan | ok, hands down, he was joking some people told me | 12:32 |
Dejan | it is possible he was joking | 12:32 |
Dejan | but he seemed terribly serious | 12:32 |
sehh | well... 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 |
Dejan | also 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 |
sehh | so the docs are really lacking... | 12:33 |
Dejan | I was SO PISSED OFF when they sacked Grant | 12:33 |
sehh | well, 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 |
sehh | oh.. | 12:33 |
Dejan | not really | 12:33 |
Dejan | PHP is stagnating | 12:34 |
Dejan | it was very popular few years ago, but now some new technologies are becomming more popular | 12:34 |
sehh | well, I don't know about PHP as a language, but I don't see anything other than PHP being used for web development | 12:34 |
Dejan | still, stopping the support for the "dynamic languages" as I called them on the UK IUA conference is bordering with idiocy | 12:35 |
Dejan | (because I asked about "dynamic languages" support) | 12:35 |
Dejan | the only dynamic language I use is PHP | 12:36 |
Dejan | but some other people use Python, Ruby, PERL | 12:36 |
Dejan | sehh, Java and .NET are more popular now, I believe | 12:36 |
Dejan | for web development | 12:36 |
Dejan | for several valid reasons | 12:37 |
sehh | well, not where I work or with the businesses I'm related to. Everything is PHP for web development | 12:37 |
Dejan | I do PHP development since '96 | 12:38 |
Dejan | it was nice long ago | 12:38 |
sehh | java 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 |
Dejan | now Java and .NET are better solutions for medium-to-large websites | 12:38 |
Dejan | PHP is okay for small website | 12:39 |
sehh | hmm | 12:39 |
Dejan | some Drupal website etc | 12:39 |
Dejan | Java, believe it or not, is much faster solution than PHP | 12:39 |
Dejan | even with default configuration :) | 12:39 |
Dejan | out-of-box Jboss with a typical web app is waaaay faster than php | 12:40 |
Dejan | not to mention scalability | 12:40 |
Dejan | but we are off-topic here | 12:40 |
Dejan | one hint: php is an interpreted language | 12:40 |
DerMeister | Another off-topic question: Is anyone in this channel an Ingres employee? | 12:42 |
Dejan | aross is | 12:42 |
Dejan | they hired him back | 12:42 |
Dejan | so he can continue with Geospatial | 12:42 |
Dejan | (thank God) | 12:42 |
Dejan | derylm is also working for Ingres | 12:43 |
Dejan | i do not know if atrofast is working for ingres again or not | 12:43 |
*** DerMeister has quit IRC | 13:05 | |
*** DerMeister has joined #ingres | 13:06 | |
*** DerMeister has quit IRC | 13:52 | |
*** Dejan has quit IRC | 14:03 | |
*** Alex| has quit IRC | 18:07 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!