From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | David Fetter <david(at)fetter(dot)org>, SF Postgres <sfpug(at)postgresql(dot)org> |
Subject: | Re: Parameterized trigger? |
Date: | 2003-09-09 23:38:10 |
Message-ID: | 200309091638.10320.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | sfpug |
David,
> Is this workable as designed? If not, what is? I'm running 7.3.4, if
> that matters...
No. In fact, doing it in PL/pgSQL at all is not particularly workable at
this stage. PL/pgSQL simply doesn't allow ordinal naming of columns. You
would have to do a loop through pg_class and pg_attribute to get the field
names, and then execute the whitespace trim as a dynamic execute statement.
Actually, now that you mention it, this could be rather interesting as a
programming challenge. Here's your options:
1) I can tackle writing you a generic function which could be wrapped in a
trigger for each relevant table. However, performance would not be great;
and I can't even think about it until next week.
2) You could get someone else to do it in C.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | elein | 2003-09-10 01:24:54 | Re: Parameterized trigger? |
Previous Message | David Fetter | 2003-09-09 23:13:43 | Parameterized trigger? |