pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
(no subject)
7+ messages / 3 participants
[nested] [flat]

* (no subject)
@ 1999-06-07 15:49 Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
  0 siblings, 1 reply; 7+ messages in thread

From: Piotr Stelmaszyk @ 1999-06-07 15:49 UTC (permalink / raw)
  To: pgsql-interfaces

hi,

i'm trying to drop table in plpgsql trigger.
the problem is that table name depends on ID of object
that is to be removed.

so:
<cut>
declare
  t text;
begin
  t := 'objects' || trim(OLD.id);
  drop table t;
end
</cut>

psql prints error:
<cut>
ERROR: parser: parse error at or near "$1"
</cut>

what may be the problem? what does it mean "$1"? i don't have
any function arguments.

any ideas? thanx.


/--------------------------------------------------------/
/- Piotr Stelmaszyk |---- Student of Computer Science ---/
/------------------ | at Poznan University of Technology /
/----- mailto:kelman@fanthom.math.put.poznan.pl ---------/
/----- mailto:kelman@alpha.net.pl -----------------------/
/--------------------------------------------------------/





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re:
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
@ 1999-06-07 16:23 ` Herouth Maoz <herouth@oumail.openu.ac.il>
  1999-06-07 21:11   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 21:13   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 21:15   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  0 siblings, 3 replies; 7+ messages in thread

From: Herouth Maoz @ 1999-06-07 16:23 UTC (permalink / raw)
  To: Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>; pgsql-interfaces

At 18:49 +0300 on 07/06/1999, Piotr Stelmaszyk wrote:


> what may be the problem? what does it mean "$1"? i don't have
> any function arguments.
>
> any ideas? thanx.

The problem is that the parameter passed to "drop table" should not be a
string but a table. You don't write

   DROP TABLE 'my_table',

but

   DROP TABLE my_table.

So you are passing it the wrong kind of object. You should pass a table,
not the name of a table. There is a difference.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re[2]: drop table  'text'
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
@ 1999-06-07 21:11   ` Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  2 siblings, 0 replies; 7+ messages in thread

From: Piotr Stelmaszyk @ 1999-06-07 21:11 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: Herouth Maoz <herouth@oumail.openu.ac.il>

Monday, June 07, 1999, 6:23:56 PM, you wrote:

HM>    DROP TABLE 'my_table',
HM> but
HM>    DROP TABLE my_table.
thank You
i _do_ understand problem now, but i still don't know the sollution.
How can I drop table which name is evaluated from variable and text?
(in plpgsql of course)

/--------------------------------------------------------/
/- Piotr Stelmaszyk |---- Student of Computer Science ---/
/------------------ | at Poznan University of Technology /
/----- mailto:kelman@fanthom.math.put.poznan.pl ---------/
/----- mailto:kelman@alpha.net.pl -----------------------/
/--------------------------------------------------------/





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re[2]: drop table  'text'
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
@ 1999-06-07 21:13   ` Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-08 06:31     ` Re: [INTERFACES] Re[2]: drop table  'text' Anatoly K. Lasareff <tolik@icomm.ru>
  1999-06-08 09:22     ` Re: [INTERFACES] Re[2]: drop table  'text' Herouth Maoz <herouth@oumail.openu.ac.il>
  2 siblings, 2 replies; 7+ messages in thread

From: Piotr Stelmaszyk @ 1999-06-07 21:13 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: herouth@oumail.openu.ac.il

Monday, June 07, 1999, 6:23:56 PM, you wrote:

HM>    DROP TABLE 'my_table',
HM> but
HM>    DROP TABLE my_table.
thank You
i _do_ understand problem now, but i still don't know the sollution.
How can I drop table which name is evaluated from variable and text?
(in plpgsql of course)

/--------------------------------------------------------/
/- Piotr Stelmaszyk |---- Student of Computer Science ---/
/------------------ | at Poznan University of Technology /
/----- mailto:kelman@fanthom.math.put.poznan.pl ---------/
/----- mailto:kelman@alpha.net.pl -----------------------/
/--------------------------------------------------------/





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] Re[2]: drop table  'text'
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
  1999-06-07 21:13   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
@ 1999-06-08 06:31     ` Anatoly K. Lasareff <tolik@icomm.ru>
  1 sibling, 0 replies; 7+ messages in thread

From: tolik@icomm.ru @ 1999-06-08 06:31 UTC (permalink / raw)
  To: Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>; +Cc: pgsql-interfaces; herouth@oumail.openu.ac.il

>>>>> "PS" == Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl> writes:

 PS> Monday, June 07, 1999, 6:23:56 PM, you wrote:
 HM> DROP TABLE 'my_table',
 HM> but
 HM> DROP TABLE my_table.
 PS> thank You
 PS> i _do_ understand problem now, but i still don't know the sollution.
 PS> How can I drop table which name is evaluated from variable and text?
 PS> (in plpgsql of course)

I think there is no solution this problem in 'plpgsql'

-- 
Anatoly K. Lasareff              Email:       tolik@icomm.ru 
Senior programmer



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] Re[2]: drop table  'text'
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
  1999-06-07 21:13   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
@ 1999-06-08 09:22     ` Herouth Maoz <herouth@oumail.openu.ac.il>
  1 sibling, 0 replies; 7+ messages in thread

From: Herouth Maoz @ 1999-06-08 09:22 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: pgsql-interfaces

At 09:31 +0300 on 08/06/1999, Anatoly K. Lasareff wrote:


>  PS> Monday, June 07, 1999, 6:23:56 PM, you wrote:
>  HM> DROP TABLE 'my_table',
>  HM> but
>  HM> DROP TABLE my_table.
>  PS> thank You
>  PS> i _do_ understand problem now, but i still don't know the sollution.
>  PS> How can I drop table which name is evaluated from variable and text?
>  PS> (in plpgsql of course)
>
> I think there is no solution this problem in 'plpgsql'

Neither do I. I think you will have to write in C or in pl/pgtcl. Either
that, or have a big conditional that maps all possible combinations.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re[2]: drop table  'text'
  1999-06-07 15:49 (no subject) Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
@ 1999-06-07 21:15   ` Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
  2 siblings, 0 replies; 7+ messages in thread

From: Piotr Stelmaszyk @ 1999-06-07 21:15 UTC (permalink / raw)
  To: pgsql-interfaces

Monday, June 07, 1999, 6:23:56 PM, you wrote:

HM>    DROP TABLE 'my_table',
HM> but
HM>    DROP TABLE my_table.
thank You
i _do_ understand problem now, but i still don't know the sollution.
How can I drop table which name is evaluated from variable and text?
(in plpgsql of course)

ps. sorry for previous "subjectless" email
/--------------------------------------------------------/
/- Piotr Stelmaszyk |---- Student of Computer Science ---/
/------------------ | at Poznan University of Technology /
/----- mailto:kelman@fanthom.math.put.poznan.pl ---------/
/----- mailto:kelman@alpha.net.pl -----------------------/
/--------------------------------------------------------/





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~1999-06-08 09:22 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-07 15:49  Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
1999-06-07 16:23 ` Re: Herouth Maoz <herouth@oumail.openu.ac.il>
1999-06-07 21:11   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
1999-06-07 21:13   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>
1999-06-08 06:31     ` Re: [INTERFACES] Re[2]: drop table  'text' Anatoly K. Lasareff <tolik@icomm.ru>
1999-06-08 09:22     ` Re: [INTERFACES] Re[2]: drop table  'text' Herouth Maoz <herouth@oumail.openu.ac.il>
1999-06-07 21:15   ` Re[2]: drop table  'text' Piotr Stelmaszyk <kelman@fanthom.math.put.poznan.pl>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox