/
balmaster
/
postgres
Обзор
Документация
Войти
/
balmaster
/
postgres
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/pl/plperl/sql/plperl_end.sql
29 строк
780 B
Andrew Dunstan
Add plperl.on_perl_init setting to provide for initializing the perl library on load. Also, handle END blocks in plperl.
30 янв 2010, 04:46
30 янв 2010, 04:46
85d67cc
Код
Авторство
О чём код?
-- test END block handling -- Not included in the normal testing -- because it's beyond the scope of the test harness. -- Available here for manual developer testing. DO $do$ my $testlog = "/tmp/pgplperl_test.log"; warn "Run test, then examine contents of $testlog (which must already exist)\n"; return unless -f $testlog; use IO::Handle; # for autoflush open my $fh, '>', $testlog or die "Can't write to $testlog: $!"; $fh->autoflush(1); print $fh "# you should see just 3 'Warn: ...' lines: PRE, END and SPI ...\n"; $SIG{__WARN__} = sub { print $fh "Warn: @_" }; $SIG{__DIE__} = sub { print $fh "Die: @_" unless $^S; die @_ }; END { warn "END\n"; eval { spi_exec_query("select 1") }; warn $@; } warn "PRE\n"; $do$ language plperlu;