pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Triggers to create Tables
2+ messages / 1 participants
[nested] [flat]

* Triggers to create Tables
@ 1999-02-19 17:37 Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>
  1999-02-20 11:33 ` Re: [SQL] Triggers to create Tables Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>
  0 siblings, 1 reply; 2+ messages in thread

From: Martin Möderndorfer @ 1999-02-19 17:37 UTC (permalink / raw)
  To: pgsql-sql

hi,

this is the part II of a question i already asked:

i have some tables:
create table css_class(nr int4, classname varchar(50));
create table css_prop(nr int4, name varchar(50), val varchar(50),
classnr int4);
(css_prop.classnr foreign key-> css_class.nr)

i would need a trigger on update and insert who takes all entries from
the tables above and put them into a textfile in the following stype

.n-th_of_css_class {
	n-th_of_css_prop.name(*) : n-th_of_css_prop.val(*);
	n+1-th_of_css_prop.name(*): [...]
}
.n+1-th_of_css_class { [...]

with other words: i want to create a cascading style sheet out of the
table:
css files look something like that

.cassname {
	property1 : value_prop1;
	property2 : value_prop2;
	[...]
}
[...]

Can anyone help?
a c-function would be ok too (_really_ think that i need one) but the
file has to be created by the database itself.

Idea for the future: whole html pages built out of the databased
resulted by trigger/query combination. (not the question _yet_)

MArtin



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

* Re: [SQL] Triggers to create Tables
  1999-02-19 17:37 Triggers to create Tables Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>
@ 1999-02-20 11:33 ` Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Martin Möderndorfer @ 1999-02-20 11:33 UTC (permalink / raw)
  To: Anatoly K. Lasareff <tolik@icomm.ru>; +Cc: pgsql-sql

Hm,

Stylesheets do not change often, it would be better to read them from
textfile than querying the database at the beginning of each html file
which includes it.

MArtin

"Anatoly K. Lasareff" wrote:
> 
> >>>>> "d" == derndorfer  <Martin> writes:
> 
>  d> hi,
>  d> this is the part II of a question i already asked:
> 
>  d> i have some tables:
>  d> create table css_class(nr int4, classname varchar(50));
>  d> create table css_prop(nr int4, name varchar(50), val varchar(50),
>  d> classnr int4);
>  d> (css_prop.classnr foreign key-> css_class.nr)
> 
>  d> i would need a trigger on update and insert who takes all entries from
>  d> the tables above and put them into a textfile in the following stype
> 
>  d> .n-th_of_css_class {
>  d> n-th_of_css_prop.name(*) : n-th_of_css_prop.val(*);
>  d> n+1-th_of_css_prop.name(*): [...]
>  d> }
>  d> .n+1-th_of_css_class { [...]
> 
>  d> with other words: i want to create a cascading style sheet out of the
>  d> table:
>  d> css files look something like that
> 
>  d> .cassname {
>  d> property1 : value_prop1;
>  d> property2 : value_prop2;
>  d> [...]
>  d> }
>  d> [...]
> 
>  d> Can anyone help?
>  d> a c-function would be ok too (_really_ think that i need one) but the
>  d> file has to be created by the database itself.
> 
>  d> Idea for the future: whole html pages built out of the databased
>  d> resulted by trigger/query combination. (not the question _yet_)
> 
>  d> MArtin
> 
> I think this is bad idea to build text file every time you change the
> tables. What about external program (on C, Perl... etc) what rebuilds,
> pehaps incrementally, file(s) with changed data? Or creating style
> sheets and html pages 'on the fly' with any cgi-script?
> 
> --
> Anatoly K. Lasareff              Email:       tolik@icomm.ru
> Senior programmer



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


end of thread, other threads:[~1999-02-20 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-02-19 17:37 Triggers to create Tables Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>
1999-02-20 11:33 ` Martin Möderndorfer <mmoedern@linux.stuco.uni-klu.ac.at>

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