On Thursday 18 Jul 2002 4:18 pm, [EMAIL PROTECTED] wrote:
> I know this is off topic, but I know many of you use PostgreSQL so I
> thought I would start here. I  am writing a query in a function that
> does not work and was wondering if anyone sees a problem. My table
> follows:
>
> Table 1
> ----------
> id_user
> rel_id_section
> idx_registration
>
> And the Function is:
>
>     CREATE OR REPLACE FUNCTION unregister_user() RETURNS OPAQUE AS '
>         DECLARE
>             current_registration  int2;
>             maximum_registration  int2;
>         BEGIN
>
>             SELECT INTO registration_record *
>                    FROM registration
>                    WHERE rel_id_section = OLD.rel_id_section AND
>                          id_user = OLD.id_user;
>             IF FOUND THEN
>                 RAISE EXCEPTION ''user is enrolled'';
>             ELSE
>                 RAISE EXCEPTION ''No registration exists: %, %'',
>                                 OLD.id_user, OLD.rel_id_section;
>             END IF;
>             RETURN NULL;
>         END
>     ' LANGUAGE 'plpgsql';
>
> I have put a delete trigger that runs this function and it does not
> matter if the record exists or not it always returns that "No
> registration exists." If I remove the portion of the where clause
> that verifies the user the query works fine. I belive I need to quote
> the data or something, but can not find in the docs how.
>
> Does anyone have any ideas?
>
> Thanks,
> Chad

Hi Chad,

While I can't help with your problem, I will make a suggestion.

Try on the PostgreSQL mailing list, [EMAIL PROTECTED]

The subscription form is available at 
http://developer.postgresql.org/mailsub.php

Gary

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to