Re: [SQL] [GENERAL] Get current trasanction id

2004-12-27 Thread Marek Lewczuk
Michael Fuhr napisaƅ(a): On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote: is there any way to get current transaction id using plpgsql or sql ? A couple of people have posted suggestions but I'll ask a question: Why do you want the transaction ID? What problem are you tryi

[SQL] Get current trasanction id

2004-12-27 Thread Marek Lewczuk
Hello, is there any way to get current transaction id using plpgsql or sql ? Thanks in advance for any help. ML ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] [GENERAL] how to use COPY within plperl

2004-11-08 Thread Marek Lewczuk
Goutam Paruchuri wrote: Why can you not use simple insert statements (sql insert). Copy is meant to transfer large amount of data from text files to databases and vice versa. "Insert" is much slower if there are many (hundreds, thousands) data to be inserted - and in my case there will be thousand

[SQL] how to use COPY within plperl

2004-11-08 Thread Marek Lewczuk
Hello, I need to use COPY (instead of INSERT) within plperl function. I know that COPY will work if data will be taken from file - however I need to use STDIN. I tried this: spi_exec_query("COPY sometable (field1, field2) FROM stdin;"."\n"."sometext"."\t"."sometext"."\n"."\.") But it didn't wor

Re: [SQL] [GENERAL] SQL query problem (many table in FROM statement and many LEFT JOIN's)

2003-10-09 Thread Marek Lewczuk
> > SELECT > > _CON.con_id, > Please make sure you get the quoting right regarding table > names. PostgreSQL will fold _CON into _con unless quoted > "_CON". So, it may be that you created the table with quotes > ("_CON"). Now, in your query you don't use quotes and thusly > it is looking for

[SQL] SQL query problem

2003-10-09 Thread Marek Lewczuk
Hello, I'm in the middle of the migration process from MySQL to PostgreSQL and I cannot understand why this query isn't working (in MySQL it's working fine). PG returns: ERROR: Relation "_con" does not exist This is my query: SELECT _CON.con_id, _MOD.mod_ty, _VER.version, _YEA.year, _C

[SQL] MD5() function not available ??

2003-09-14 Thread Marek Lewczuk
Hey, I've searched for MD5 crypting function in PG, but I did not find it. Anyone knows how to implement this function in PG ? Best wishes, Marek L. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archive

[SQL] MD5 function is not available ?

2003-09-11 Thread Marek Lewczuk
Hey, I've searched for MD5 crypting function in PG, but I did not find it. Anyone knows how to implement this function in PG ? Best wishes, Marek L. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

[SQL] plPGSQL bug in function creation

2003-09-08 Thread Marek Lewczuk
Hello, I think that there is a bug in plPGSQL - or maybe I don't know something about this language. Try to create this function Ok., this is the function created in plPGSQL: CREATE FUNCTION "public"."test" (text, text) RETURNS text AS' BEGIN IF $1 THEN RETURN $1; ELSE RETURN $2; E