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

Поиск
Список
Период
Сортировка
От jwieck@debis.com (Jan Wieck)
Тема Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru
Дата
Msg-id m0y74ow-000BFRC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru  (ocie@paracel.com)
Ответы Re: pl/{perl,pgsql} (was Re: AW: [HACKERS] triggers, views and ru
Список 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@debis.com (Jan Wieck) #

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Henry Spencer
Дата:
Сообщение: Re: Appended a string of text to each line in a file
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/bin/initdb initdb.sh'