NOVICE - first time trigger and function

From: sam(at)edup(dot)tudelft(dot)nl (Sam)
To: pgsql-novice(at)postgresql(dot)org
Subject: NOVICE - first time trigger and function
Date: 2003-11-06 11:15:54
Message-ID: ff8cfc7.0311060315.1aa1746d@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Browse pgsql-novice by date

  From Date Subject
Next Message Robert C. Mosher II 2003-11-06 20:30:25 Giving a user a database
Previous Message Bruno Wolff III 2003-11-06 02:29:40 Re: DISTINCT ... ORDER BY