Fred Blaise <[EMAIL PROTECTED]> writes:
> On Tue, 2005-03-15 at 09:58 -0500, John DeSoi wrote:
>> raise log ''t is %'', t;

> Yes, that's what I thought... but oddly nothing gets written.

Fred, your original example made it look like you were writing "
(one double quote mark) where what you need to write is ''
(two single quote marks).  The reason is that you are trying to
embed a single quote mark in the value of a string literal.
(If you are using PG 8.0 I'd suggest adopting the dollar-quoting
style for entering the function body, instead.)

Another problem I noticed is you were leaving off required
statement-ending semicolons, which could also prevent the plpgsql
parser from recognizing the RAISE command properly.

You might try something simpler just to get your feet wet:

        create function hello_world(text) returns text as '
        begin
                raise notice ''I got %'', $1;
                return $1;
        end' language plpgsql;

        select hello_world('Hi there!');

Once you get past that you'll have some idea about the quote marks
anyway ...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to