Re: [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 trying to sol

Re: [GENERAL] error : syntax error at or near $1 for over select rows

2004-12-27 Thread John DeSoi
On Dec 27, 2004, at 11:36 AM, vinita bansal wrote: FOR for1 in select qi.tril_gid as vQuotaInstanceGID,qi.startdate as vQIStartDate,qi.enddate as vQIEndDate from cm_quotainstance as qi, cm_quota as q, fs_agr as a where a.fs_unid = AGR_UNID and a.fs_model = q.model and qi.quota = q.tril_g

Re: [GENERAL] 8.0 rc2 Problem

2004-12-27 Thread Bruce Momjian
Peter Childs wrote: > Right just installed rc2 to test so that we can use 8.0 once its > out. Loads of nice features, Nice to see them all. Postgres 8.0 seams > faster, but this might be due to the reload. Oh the point in time > recovery feature are there any example scripts to say copy the

Re: [GENERAL] 8.0 rc2 Problem

2004-12-27 Thread Peter Childs
Tom Lane wrote: Peter Childs <[EMAIL PROTECTED]> writes: 2. I loaded out 7.4 database on via a dump and reload. Once done I keep getting errors when it trys to analyse (I'm using autovacuum) Nothing unsuall just a straght forward pg_dump from 7.4 loaded into 8.0. Dec 27 07:34:45 ex37 p

Re: [GENERAL] PostgreSQL training curriculum

2004-12-27 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On Tue, 21 Dec 2004, Jim C. Nasby wrote: I've been contracted to provide 3 days of PostgreSQL training, and I'm wondering if anyone has curriculum they'd like to share with me, or suggestions for course materials. This course is targeted at database

Re: [GENERAL] 8.0 rc2 Problem

2004-12-27 Thread Tom Lane
Peter Childs <[EMAIL PROTECTED]> writes: > 2. I loaded out 7.4 database on via a dump and reload. Once done I keep > getting errors when it trys to analyse (I'm using autovacuum) Nothing > unsuall just a straght forward pg_dump from 7.4 loaded into 8.0. > Dec 27 07:34:45 ex37 postgres[5745]: [28

[GENERAL] error : syntax error at or near $1 for over select rows

2004-12-27 Thread vinita bansal
This is the error i am getting when calling select * from cas_reset_qi_changedate('CAS','2003-02-03' ERROR: syntax error at or near "$1" at character 25 CONTEXT: PL/pgSQL function "cas_reset_qi_changedate" line 15 at for over select rows pgsql function : CREATE or replace FUNCTION qe13.CAS_RE

Re: [GENERAL] Get current trasanction id

2004-12-27 Thread Michael Fuhr
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 trying to solve? -- Michael Fuhr

Re: [GENERAL] Where is the error

2004-12-27 Thread Kaloyan Iliev Iliev
Hi again, When I chage in the dump file CREATE FUNCTION int (boolean) RETURNS integer AS ' select CASE WHEN $1 THEN 1 ELSE 0 END ' LANGUAGE sql; ERROR: syntax error at or near "(" at character 21 I receive this message. So the question is how to create it without quotes. Thank in advance:) Kaloyan

Re: [GENERAL] Where is the error

2004-12-27 Thread Kaloyan Iliev Iliev
Thanks To you all. The problem was that the int was reserved. When I try CREATE FUNCTION my_int(boolean) RETURNS integer AS ' select CASE WHEN $1 THEN 1 ELSE 0 END ' LANGUAGE sql; it worked. But now I have to change it on many places. This is not good beacause on the old version of PG (form where

Re: [GENERAL] Where is the error

2004-12-27 Thread Andreas Kretschmer
begin Kaloyan Iliev Iliev <[EMAIL PROTECTED]> wrote: > Hi > I have the following function: > CREATE OR REPLACE FUNCTION "int" (boolean) RETURNS integer AS' I'm not sure. But 'int' is reserved, possibly is this the error. CREATE OR REPLACE FUNCTION my_int (boolean) RETURNS integer AS' select CA

Re: [GENERAL] Where is the error

2004-12-27 Thread Kaloyan Iliev Iliev
10x John, You are right.The problem is that the function was dumped with quotes from pg_dump but I suppose the one who created it used quotes and that's why it dumps in this way. I will fix this in the dump. Thanks again. Kaloyan John DeSoi wrote: On Dec 27, 2004, at 6:42 AM, Kaloyan Iliev I

Re: [GENERAL] Where is the error

2004-12-27 Thread Marek Lewczuk
Kaloyan Iliev Iliev napisaÅ(a): Hi I have the following function: select int('t'::bool); ERROR: syntax error at or near "(" at character 11 "int" is reserved for integer type, so you should not use it. However if you add namespace before function name "public.int(TRUE)" then it should work. ML

Re: [GENERAL] Where is the error

2004-12-27 Thread John DeSoi
On Dec 27, 2004, at 6:42 AM, Kaloyan Iliev Iliev wrote: CREATE OR REPLACE FUNCTION "int" (boolean) RETURNS integer AS' select CASE WHEN $1 THEN 1 ELSE 0 END 'LANGUAGE 'sql'; The problem is that you have quoted the function name as "int". You should only do this when you want to force the exact cas

Re: [GENERAL] Get current trasanction id

2004-12-27 Thread Martijn van Oosterhout
I'm sure there's many tricky ways, but one simple way would be to insert a row into a table and then grab its XMIN value... Hope this helps, On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote: > Hello, > is there any way to get current transaction id using plpgsql or sql ? > > Thanks

[GENERAL] Where is the error

2004-12-27 Thread Kaloyan Iliev Iliev
Hi I have the following function: CREATE OR REPLACE FUNCTION "int" (boolean) RETURNS integer AS' select CASE WHEN $1 THEN 1 ELSE 0 END 'LANGUAGE 'sql'; When I try to use it: select int('t'::bool); ERROR: syntax error at or near "(" at character 11 I am using PG8.0b1 Thank you. Kaloyan -

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

2004-12-27 Thread Achilleus Mantzios
O Marek Lewczuk έγραψε στις Dec 27, 2004 : > Hello, > is there any way to get current transaction id using plpgsql or sql ? Maybe write a C function which calls GetCurrentTransactionId(). > > Thanks in advance for any help. > > ML > > > > ---(end of broadcast)--

[GENERAL] 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 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" t