Обсуждение: Re: Windows Installation error
> This error is shown after choose the language in the > installation of Postgresql 8.0.3 in windows 2000: > > "The installer has detected an incompatible version of > OpenSSL installed in your system PATH. PostgreSQL requires > OpenSSL 0.9.7 or later. If you remove your OpenSSL files > (LIBEAY32.DLL and SSLEAY32.DLL) the installer will install > the new versioon automatically. " > > but when i press OK installation seems to be normal. I didn't > delete the files because i don't know if these new files can > change something in another program. The installation > finished and i don't know if my database won't have any > problem becauseof this error. Were the files updated? do i > have to install again? You will most likely run into problems *if* you enable SSL connections. As long as you don't use SSL connections, you should be fine. It's for just tihs reason that the instlaler proceeds even though it detects a problem - it might not affect you. The files were *not* updated. If you are going to use the SSL functionality, you need to get them upgraded. One way is to remove the old ones and then reinstlal postgresql. If you don't want to do that, you can just grab the latest openssl DLLs from their site and replace the files with them, and postgresql will happily use this. For 8.1 we'll use OpenSSL libraries stored in the postgresql directory, so they will not conflict with whatever is on your system already. //Magnus
I need to know if there is a tool that convert oracle procedures and triggers to plpgsql syntax. Please, can anybody tell me where do i download it from?, i'll thank you a lot. Rafael _________________________________________________________________ Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
Rafael Montoya wrote: > I need to know if there is a tool that convert oracle procedures and > triggers to plpgsql syntax. Please, can anybody tell me where do i > download it from?, i'll thank you a lot. I don't know of a free tool that will do procedures. Probably worth reading through Oracle notes here: http://techdocs.postgresql.org/ Also - search for "ora2pg" - might be useful. If you have money to spend, it might be worth checking out EnterpriseDB - they claim to have Oracle compatibility. News item/company site below. http://www.postgresql.org/about/news.367 http://www.enterprisedb.com/ HTH -- Richard Huxton Archonet Ltd
dev@archonet.com (Richard Huxton) writes: > If you have money to spend, it might be worth checking out > EnterpriseDB - they claim to have Oracle compatibility. News > item/company site below. > http://www.postgresql.org/about/news.367 > http://www.enterprisedb.com/ It would be quite useful to have some sort of general idea as to what the "closer compatibility to Oracle" of EnterpriseDB means. -- output = reverse("gro.mca" "@" "enworbbc") http://cbbrowne.com/info/sgml.html Referring to undocumented private communications allows one to claim virtually anything: "we discussed this idea in our working group last year, and concluded that it was totally brain-damaged". -- from the Symbolics Guidelines for Sending Mail
On Thu, 2005-10-20 at 12:35 -0400, Chris Browne wrote: > dev@archonet.com (Richard Huxton) writes: > > If you have money to spend, it might be worth checking out > > EnterpriseDB - they claim to have Oracle compatibility. News > > item/company site below. > > http://www.postgresql.org/about/news.367 > > http://www.enterprisedb.com/ > > It would be quite useful to have some sort of general idea as to what > the "closer compatibility to Oracle" of EnterpriseDB means. Well that would be a question for EnterpriseDB and their marketing/tech staff. There product is completely closed and there is no documentation online. Sincerely, Joshua D. Drake -- The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/
I'm migrating from oracle to postgresl, and i have these 2 problems: 1. PostgreSQL doesn't support function DECODE from Oracle, but it can be replicated with CASE WHEN expr THEN expr [...] ELSE expr END , the problem appears when i want to convert this sentence from oracle to postgresl: select decode (pre.C_GEN,'01','M','02','F','') as GENERO my convertion is case when pre.C_GEN = '01' then GENERO='M' else GENERO='F' end , but i dont' know if the assigment of GENERO is correct. 2. Writing triggers i don't know if postgresql supports statements like this: CREATE OR REPLACE TRIGGER trig AFTER UPDATE OF column2 <<----- Here is the doubt ON table_product FOR EACH ROW BEGIN ... END In postgresql: CREATE OR REPLACE TRIGGER trig AFTER UPDATE OF column2 <<----- is this correct? ON table_product FOR EACH ROW EXECUTE PROCEDURE trig(); Thanks for your answers.. Rafael _________________________________________________________________ ¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en MSN Motor. http://motor.msn.es/researchcentre/
On Tue, 2005-10-25 at 00:16 +0200, Rafael Montoya wrote: > I'm migrating from oracle to postgresl, and i have these 2 problems: > > 1. > PostgreSQL doesn't support function DECODE from Oracle, but it can be > replicated with > CASE WHEN expr THEN expr [...] ELSE expr END , the problem appears when i > want to convert this sentence from oracle to postgresl: > select decode (pre.C_GEN,'01','M','02','F','') as GENERO > my convertion is > case when pre.C_GEN = '01' then GENERO='M' else GENERO='F' > end , > but i dont' know if the assigment of GENERO is correct. SELECT CASE WHEN re.C_GEN = '01' THEN 'M' ELSE 'F' END AS GENER0 > 2. > Writing triggers i don't know if postgresql supports statements like this: > CREATE OR REPLACE TRIGGER trig > AFTER UPDATE OF column2 <<----- Here is the doubt > ON table_product > FOR EACH ROW > BEGIN > ... > END > > In postgresql: > CREATE OR REPLACE TRIGGER trig CREATE TRIGGER does not support CREATE OR REPLACE > AFTER UPDATE OF column2 <<----- is this correct? No. PostgreSQL doesn't support column triggers yet. > ON table_product > FOR EACH ROW EXECUTE PROCEDURE trig(); CREATE TRIGGER trig AFTER UPDATE ON table_product FOR EACH ROW EXECUTE PROCEDURE trig(); In trig() you need to make the action conditional: IF NEW.column2 <> OLD.column2 OR (NEW.column2 IS NULL) <> (OLD.column2 IS NULL) THEN ... END IF; (assuming it's written in plpgsql). -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html
Thanks for your answer, and if i have many options like decode (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') as Est do i have to write many else options in this way? select case when pre.C_EST = '01' THEN 'U' ELSE when pre-C_EST = '02' THEN 'M' ... END AS EST Rafael >From: Oliver Elphick <olly@lfix.co.uk> >Reply-To: olly@lfix.co.uk >To: Rafael Montoya <rafo-mm@hotmail.com> >CC: pgsql-general@postgresql.org >Subject: Re: [GENERAL] function DECODE and triggers >Date: Tue, 25 Oct 2005 10:15:17 +0100 > >On Tue, 2005-10-25 at 00:16 +0200, Rafael Montoya wrote: > > I'm migrating from oracle to postgresl, and i have these 2 problems: > > > > 1. > > PostgreSQL doesn't support function DECODE from Oracle, but it can be > > replicated with > > CASE WHEN expr THEN expr [...] ELSE expr END , the problem appears when >i > > want to convert this sentence from oracle to postgresl: > > select decode (pre.C_GEN,'01','M','02','F','') as GENERO > > my convertion is > > case when pre.C_GEN = '01' then GENERO='M' else >GENERO='F' > > end , > > but i dont' know if the assigment of GENERO is correct. > >SELECT CASE WHEN re.C_GEN = '01' THEN 'M' ELSE 'F' END AS GENER0 > > > 2. > > Writing triggers i don't know if postgresql supports statements like >this: > > CREATE OR REPLACE TRIGGER trig > > AFTER UPDATE OF column2 <<----- Here is the doubt > > ON table_product > > FOR EACH ROW > > BEGIN > > ... > > END > > > > In postgresql: > > CREATE OR REPLACE TRIGGER trig > >CREATE TRIGGER does not support CREATE OR REPLACE > > > AFTER UPDATE OF column2 <<----- is this correct? > >No. PostgreSQL doesn't support column triggers yet. > > > ON table_product > > FOR EACH ROW EXECUTE PROCEDURE trig(); > >CREATE TRIGGER trig > AFTER UPDATE > ON table_product > FOR EACH ROW EXECUTE PROCEDURE trig(); > >In trig() you need to make the action conditional: > > IF NEW.column2 <> OLD.column2 OR > (NEW.column2 IS NULL) <> (OLD.column2 IS NULL) THEN > ... > END IF; > >(assuming it's written in plpgsql). >-- >Oliver Elphick olly@lfix.co.uk >Isle of Wight http://www.lfix.co.uk/oliver >GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA > ======================================== > Do you want to know God? http://www.lfix.co.uk/knowing_god.html > _________________________________________________________________ Moda para esta temporada. Ponte al día de todas las tendencias. http://www.msn.es/Mujer/moda/default.asp
On Tue, 2005-10-25 at 18:31 +0200, Rafael Montoya wrote: > Thanks for your answer, and if i have many options like > > decode (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') > as Est > > do i have to write many else options in this way? > > select case when pre.C_EST = '01' THEN 'U' > ELSE when pre-C_EST = '02' THEN 'M' > ... > END AS EST > > Rafael The syntax is CASE WHEN condition1 THEN value1 WHEN condition2 THEN value2 ... ELSE default_value END Oliver
Rafael Montoya wrote: > Thanks for your answer, and if i have many options like > > decode > (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') as Est > > do i have to write many else options in this way? > > select case when pre.C_EST = '01' THEN 'U' > ELSE when pre-C_EST = '02' THEN 'M' > ... > END AS EST You could write a stored procedure that does what you want. -- Alban Hertroys alban@magproductions.nl magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede //Showing your Vision to the World//
I have this statement in oracle: CREATE OR REPLACE TRIGGER trig AFTER INSERT OR UPDATE OR DELETE OF column2 <<----- Here is the doubt ON table_product FOR EACH ROW BEGIN ... END Migrating to PostgreSQL, the conditionals for AFTER UPDATE OF COLUMN2 in trig() are: IF NEW.column2 <> OLD.column2 OR (NEW.column2 IS NULL) <> (OLD.column2 IS NULL) THEN ... END IF; but, i can not found the conditionals for AFTER INSERT OF COL2 and AFTER DELETE OF COL2, please, give me a hand. Thanks Rafael _________________________________________________________________ Acepta el reto MSN Premium: Protección para tus hijos en internet. Descárgalo y pruébalo 2 meses gratis. http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil
On Tue, Nov 01, 2005 at 12:33:47AM +0100, Rafael Montoya wrote: > I have this statement in oracle: > > CREATE OR REPLACE TRIGGER trig > AFTER INSERT OR UPDATE OR DELETE OF column2 <<----- Here is the doubt > ON table_product > FOR EACH ROW > BEGIN > ... > END > > Migrating to PostgreSQL, the conditionals for AFTER UPDATE OF COLUMN2 in > trig() are: > > IF NEW.column2 <> OLD.column2 OR > (NEW.column2 IS NULL) <> (OLD.column2 IS NULL) THEN > ... > END IF; A simpler condition would be IF NEW.column2 IS DISTINCT FROM OLD.column2 THEN ... END IF; IS DISTINCT FROM is like <> except that it works with NULL: NULL IS DISTINCT FROM NULL -- false NULL IS DISTINCT FROM something -- true If you're using the same function for insert, update, and delete triggers then you'll need to check TG_OP before executing the above code; otherwise you'll get an error like 'record "old" is not assigned yet'. IF TG_OP = 'UPDATE' THEN IF NEW.column2 IS DISTINCT FROM OLD.column2 THEN ... END IF; END IF; The nested IF is necessary because you can't depend on short-circuiting as in some other languages. > but, i can not found the conditionals for AFTER INSERT OF COL2 and AFTER > DELETE OF COL2, please, give me a hand. Does a column list affect trigger behavior for inserts and deletes? I don't see those behaviors defined in SQL:2003: <trigger event> ::= INSERT | DELETE | UPDATE [ OF <trigger column list> ] What, if anything, is different between "AFTER INSERT OF COL2" and a simple "AFTER INSERT"? -- Michael Fuhr