Re: [GENERAL] re-post

1999-09-01 Thread amy cheng

>I can answer least 50% on all of your question only after reading the
>"programmer's guide",
>one night,( and was also doin' a Postgres+Apache+PHP installation in
>parallel).
>So did you rtfm?
OK, I understand you are smart! BTW, what is "rtfm" ;-)

> > the difference between PL/pgSQL and tcl (note that postgreSQL also 
>support
> > tcl now),
>eww, a big one. tcl is rather a programming language, PL/pgSQL, as it's
>name states
>is a procedural language, used only in functions.
postgresql now also use tcl as its "intra-server" procedural language.
I have the feeling that tcl is more powerful than PL/pgSQL, and also
tcl is more generally used, seems to me tcl is the future direction,
although PL/pgSQL has more examples now (and closer to Oracle guys).

>
> > does PL/pgSQL support array-like feature? how about tcl in postgreSQL?
>dunno, did you try?
no. I'm a newbie, but a serious one. That is why I asked so many "non 
technical" questions.

>
> > if I want use OS (i.e. external to dababase), can I use PL/pgSQL or tcl? 
>if
> > in C (spi), is it easy? anyway to get perl involved?
>?? I didn't get this Q, if you are refering to postgres API, if you can
>use PL/pgSQL
>in, say, C code, I think everything that backend sais is valid, will be.
>Also have a look @ ecpg. The cleaner way is through libpq. And the C++
>API looks also nice.
>And yep , you can get perl involved through it's DBI.
I guess what I'm really asking is:

1) can I somehow use perl to
write triggers (and "stored procedures" in general) -- I understand it is 
not possible for the whole part, it is only possible for
PL/pgSQL, tcl and C, but can I wirte part of it ? i.e., called by C or tcl 
or PL/pgSQL? Why I want to do this? this leads to the second
question:
2) I want to do copy-file-kind of thing in trigger. I know it can
be done through application side. But that is not convenient. And
to do that easily, as everybody knows :-), perl is the best. However, even 
without perl, is PL/pgSQL and tcl possible? I assume C can
do it, anybody tried? easy to do?


amy

__
Get Your Private, Free Email at http://www.hotmail.com





Re: [GENERAL] How to display user-defined functions?

1999-09-01 Thread José Soares

Your functions are stored in the table pg_proc.
If you want to display the text of a function, try this:

select PROSRC from pg_proc  where proname = 'your_function_name';

José

Teodor Cimpoesu ha scritto:

> Mark Dalphin wrote:
> >
> > Hi,
> >
> > Is there a way to display user-defined functions?  For example, if I define a
> > function using PL/pgsql, what tables do I query and in what way to learn that
> > the function exisits and further, what its defintion is? I can find functions
> > that return known types, eg getTimeStamp, below, shows up with '\df', however
> > functions defined returning type "opaque" do not show up, eq,
> > "exon_foreign_keys", below.
>
> afaik this *should* work:
> SELECT * FROM pg_proc WHERE procname='your_f_name_here';
> I'm not sure of "procname",though
> also try to display system tables (I think \dS or something)
> and peek into other suspicious pg_* tables :)
> [snip]
> --
> CIMPOESU Teodor, Web Programmer (h)
> @ DIGICOM S.A. Bucharest, Romania
> @ Internet, site development
> @ [EMAIL PROTECTED], +(401)-330.47.28
>
> official home page ~ http://www.digiro.net/
> Internet web  page ~ http://internet.digiro.net/
>
>