Re: [SQL] Problem with function & trigger

2001-07-09 Thread Carlo Vitolo
Tom Lane wrote: > Carlo Vitolo <[EMAIL PROTECTED]> writes: > > This does not work. The error is ERROR: pg_atoi: error in "12.00": can't > > parse ".00" > > What PG version are you running? It seems to work fine for me in > current sources: > > Ver. 7.1.2 > > BTW, the way you are writing the fu

Re: [SQL] PGAccess/pgplsql Blues

2001-07-09 Thread Josh Berkus
Bruce, Thanks for checking that. You actually missed the beginning of the issue; it only crops up with long, complex functions > 100 lines including nested text quoting. I'm getting out of the habit of using PGAccess for anything but table lookups, anyway, so it's not worth it to m

Re: [SQL] PGAccess/pgplsql Blues

2001-07-09 Thread Bruce Momjian
FYI, I could not reproduce this problem in the current CVS sources. I created a function 'select 1;' and saved it, then opened the function and added a comment line, saved that, and it worked fine. > Roberto, > > > IIRC, pgaccess does quote-escaping for you, so if you try to write > > "standa

Re: [SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Alvar Freude
Hi, > So - basically you want something like: > > SELECT * from emotions > WHERE emotion_date <= [cutoff time] > ORDER BY calculated_score(date_epoch,full_rating) > LIMIT 300 yes, thats it -- nearly :-) In detail the calculated_score is: (cutoff_time - creation_time) + (sum_of_rating_points

Re: [SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Richard Huxton
From: "Alvar Freude" <[EMAIL PROTECTED]> > For now i do the hole stuff on client side with two selects: > First selecting the end_id, then (2. Statement) sort the stuff within > end_id and end_id-3000 and return the 300 most "best". > > > my $end_id = $self->db_h->selectrow_array( > "SEL

Re: [SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Alvar Freude
>> How should I do this? > > Can't at the moment. ups, OK -- then I misunderstand something ;) >> or, in more detail the exact function: >> >> >>CREATE FUNCTION get_emotions (timestamp) RETURNS SETOF records AS >> ' >> DECLARE >> start ALIAS FOR $1; >>

Re: [SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Alex Pilosov
Currently, this is not possible. It will be possible in 7.2, or with a patch I'm working on... On Mon, 9 Jul 2001, Alvar Freude wrote: > Hi, > > I want to create a function (PL/pgSQL), which return multiple rows. But it > fails -- when Creating the function, I get a notice: > > NOTICE: Pro

Re: [SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Richard Huxton
From: "Alvar Freude" <[EMAIL PROTECTED]> > Hi, > > I want to create a function (PL/pgSQL), which return multiple rows. But it > fails -- when Creating the function, I get a notice: > How should I do this? Can't at the moment. > or, in more detail the exact function: > > >CREATE FUNCTION ge

[SQL] Returning multiple Rows from PL/pgSQL-Function

2001-07-09 Thread Alvar Freude
Hi, I want to create a function (PL/pgSQL), which return multiple rows. But it fails -- when Creating the function, I get a notice: NOTICE: ProcedureCreate: return type 'records' is only a shell When executing it, this error: ERROR: fmgr_info: function 0: cache lookup failed How shoul