Re: Trigger Function and Html Output - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Trigger Function and Html Output
Date
Msg-id 018601c0bb55$a91035c0$1001a8c0@archonet.com
Whole thread Raw
In response to Trigger Function and Html Output  (Stef Telford <stef@chronozon.artofdns.com>)
List pgsql-sql
From: "Stef Telford" <stef@chronozon.artofdns.com>

> Richard Huxton wrote:
>
> Each select works on a view, rather than hardcode the view into the
> perl CGI, i would rather have the table header/column titles returned
> as the first item as text/html (i know about the func procedure to get the
> table_attributes) and then all the formatting thereafter done by the
database
> for each row.
>
> maybe i am naive in thinking this way, but surely the a database function
> formatting the returned string must be quicker then perl. (speaking
> generically of course, i conceed that there are times when the reverse
> is true)

Not sure you'd notice much of a speed difference - in most cases other
overheads will be the deciding factor. Of course, YMMV.

> thank you for the input, and if i was jst starting out i would agree with
> you. I cant really explain it any better than i have previously, but
> hopefully you will see that i want to use the database to do this.
>
> hopefully that isnt that strange a request ;)

Strange or not, it's your database and you're the only one in a position to
make this sort of decision.

I did think that it was the psql front-end that did the HTML stuff. But -
there seems to be html stuff in fe-print.c (src/interfaces/libpq) and the
Perl module Pg has html output options in $result->print(...) which might be
flexible enough for your needs.

I must admit I've never used it, so I don't know if you can add attributes
to table elements, use styles etc.

HTH

- Richard Huxton



pgsql-sql by date:

Previous
From: Sharmad Naik
Date:
Subject: passing parameters between forms
Next
From: Edipo Elder Fernandes de Melo
Date:
Subject: Calling functions inside a function: behavior