Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru

From: jwieck(at)debis(dot)com (Jan Wieck)
To: ocie(at)paracel(dot)com
Cc: jwieck(at)debis(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru
Date: 1998-02-23 20:49:48
Message-ID: m0y74ow-000BFRC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Ocie Mitchell wrote:
>
> Jan Wieck wrote:
> > > BTW.: How do you write an input or output function in pl/tcl if all you get
> > > is the external representation ?
> >
> > Impossible.
>
> We could have the backend check file permissions, open the file and
> pass the file pointer to the pl/tcl procedure. This sounds a bit
> complicated I know. It seems to me that we would want at least a
> "stdout" available to the procedure so that it can "talk to" the user.
> If we provide stdin, stdout and stderr, then we could use redirection
> to pipe input to and from a procedure.

That's not the point. With input/output functions, the
postgres data types input/output registered procedures where
ment. That are the functions, that convert one Datum from
it's external string representation into and back from it's
internal binary value used in the database tuples.

Direct file access from inside a backends function is IMHO
never a good thing. This is the job of an application
program, because the actually accessed file might be on an
NFS filesystem, this can hang and the database backend will
hang inside of a transaction where maybe even the DBA or root
cannot kill them (process is blocked inside a system call).

This is IMHO a NONO.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-02-23 20:55:12 Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/bin/initdb initdb.sh'
Previous Message Tom I Helbekkmo 1998-02-23 20:47:34 Re: [HACKERS] Current 6.3 issues