NOVICE - first time trigger and function - Mailing list pgsql-novice

From sam@edup.tudelft.nl (Sam)
Subject NOVICE - first time trigger and function
Date
Msg-id ff8cfc7.0311060315.1aa1746d@posting.google.com
Whole thread Raw
List pgsql-novice
Dear All,

I'm having trouble creating a function (it's my first time). First
I'll explain what I want to achieve:

I have two tables,I want to add a column to a table2 when a row is
inserted in table1. So i thought i could create a trigger and a
function: But I can't even get the function to do what I want. I tried
the following:

CREATE FUNCTION add_column (name) RETURNS BOOLEAN '
      ALTER TABLE table2 ADD COLUMN $1 integer
   ' LANGUAGE SQL;

I get the following error:

parser: parse error at or near "$1"

Anybody an idea?

pgsql-novice by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: [PERFORM] error while executing a c program with embedded sql
Next
From: "Farid Khan"
Date:
Subject: Primary Keys