Quick Pg/PLSQL question - Mailing list pgsql-general

From Matt Wagner
Subject Quick Pg/PLSQL question
Date
Msg-id KCEFIALOPJAEIDEHDBOAKEBJDBAA.mwagner@envex.net
Whole thread Raw
Responses Re: Quick Pg/PLSQL question  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Quick Pg/PLSQL question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hey everyone,

Trying to run a VERY simple function.  I've read through the Programmer's
Manual over and over, and continue to receive errors.  First, I ran the
following to add the language to the database:

    createlang plpgsql test

I then load the function using:

    \i test_func.sql

I then run the function by simply executing:

    select test_func() as answer;


The function I'm trying to execute is:

------------------------------------------

CREATE OR REPLACE FUNCTION test_func() RETURNS INTEGER AS '

DECLARE

BEGIN

    INSERT INTO transaction_summary VALUES (61, 1, "now", 0, 0, 0, 0);

    RETURN 1;

END;
' LANGUAGE 'plpgsql';

------------------------------------------

Very simple function, but I continue to receive errors, because of the "now"
part.  However, in the Programmer's Manual, it specifically uses "now" with
double quotes in a couple examples.  When executing the function, I continue
receiving the following errors:

NOTICE:  Error occurred while executing PL/pgSQL function test_func
NOTICE:  line 4 at SQL statement
ERROR:  Attribute 'now' not found


Any help would be greatly appreciated.

Thank you,
Matt Wagner

Envex Developments
Your CGI Script Specialists
http://www.envex.net/




pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: get date in binary number format
Next
From: Tom Lane
Date:
Subject: Re: get date in binary number format