Thread: 8.0.0beta2 and plpgsql

8.0.0beta2 and plpgsql

From
"Stefano Bonnin"
Date:
CORRECTION,
 
even if I define a stupid "hello world" trigger function the problem is present:
 
for example
 
CREATE FUNCTION sns_action () RETURNS TRIGGER AS '
BEGIN
        RAISE NOTICE ''hello world!'';
        RETURN NEW;
END;
' LANGUAGE 'plpgsql';
 
CREATE TRIGGER sns_action_tr BEFORE UPDATE OR INSERT ON "SNS_DATA" FOR EACH ROW EXECUTE PROCEDURE sns_action();
 
The table is:
 
                         Table "public.SNS_DATA"
        Column        |            Type             |     Modifiers
----------------------+-----------------------------+--------------------
 Ordine               | integer                     | not null default 0
 Cod_Par              | character varying(100)      | not null
 Cod_Ana              | character varying(100)      | not null
 Valore               | character varying(255)      |
 Descriz              | character varying(512)      |
 Un_Mis               | character varying(70)       |
 hash                 | integer                     |
 valid                | boolean                     | default true
 alarm                | boolean                     | default false
 Cod_Luogo            | character varying(30)       |
 Data_Arrivo_Campione | timestamp without time zone |
 site_id              | integer                     |
 Cod_Luogo_v          | character varying(30)       |
 repeated_val         | boolean                     | default false
Indexes:
    "sns_data2_pkey" PRIMARY KEY, btree ("Ordine", "Cod_Ana", "Cod_Par")
    "sns_datacodluogo2" btree ("Cod_Luogo")
    "sns_datatimefield2" btree ("Data_Arrivo_Campione")
    "sns_siteid2" btree (site_id)
    "sns_valid2" btree ("valid")
    "snsdata_codana" btree ("Cod_Ana")
    "snsdata_codpar" btree ("Cod_Par")
Foreign-key constraints:
    "$2" FOREIGN KEY ("Cod_Ana") REFERENCES "SNS_ANA"("Cod_Ana") ON DELETE CASCADE
Triggers:
    sns_action_tr BEFORE INSERT OR UPDATE ON "SNS_DATA" FOR EACH ROW EXECUTE PROCEDURE sns_action()
 
and the insert operation is:
 
INSERT INTO "SNS_DATA" ("Cod_Par","Cod_Ana","Valore","Descriz","Un_Mis","Cod_Luogo","Data_Arrivo_Campione",site_id,hash) VALUES ('24359','2004-09-11 03:00:0057',19.8,'Temperatura media []','°C','57',timestamp '2004-09-11 03:00:00',1,-574156802);
 
Thanks in advance for the help.
RedS

Re: 8.0.0beta2 and plpgsql

From
Alvaro Herrera
Date:
On Thu, Sep 16, 2004 at 05:43:55PM +0200, Stefano Bonnin wrote:
> CORRECTION,
>
> even if I define a stupid "hello world" trigger function the problem is present:

And this is causing a segfault?  Most likely your installation is
broken.  Try a make distclean and a full rebuild.  And make sure it's
not referencing libraries of some other installation.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)