From: | Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il> |
---|---|
To: | Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>, Postgres-General <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] PL problem |
Date: | 1999-06-14 08:38:19 |
Message-ID: | l03130300b38a6e747b24@[147.233.159.109] |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
At 10:36 +0300 on 14/06/1999, Adriaan Joubert wrote:
> I guess this may have to do with the way the query plan is stored, so
> that this may just be impossible to fix. Could somebody who knows how PL
> works please confirm whether I'm asking something impossible here?
Yep, it is impossible. DELETE FROM takes a table argument, not a string
argument. It may be hard for people to make the distinction, just remember
that:
DELETE FROM my_table WHERE...
is different from
DELETE FROM 'my_table' WHERE...
and the second form is illegal.
In C it is easier to do, because the query itself is a string, thus you can
build it from other strings. But in PL/pgsql, the query is not a string. It
is pre-compiled.
Perhaps there is a solution in PL/TCL. In general, in order to do the task
you want to be done, you need to use a language that allows building the
query as a string. Perhaps this should be added as a feature in PL/PgSQL,
as it is added to embedded-sql languages.
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
From | Date | Subject | |
---|---|---|---|
Next Message | Mirko Kaffka | 1999-06-14 08:51:18 | vacuum fails |
Previous Message | Adriaan Joubert | 1999-06-14 07:36:47 | PL problem |