Re: Postgre RAISE NOTICE and PHP

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Postgre RAISE NOTICE and PHP
Дата
Msg-id dcc563d10908181345k3bc840a9w1dd8ccb4c79d74b8@mail.gmail.com
обсуждение исходный текст
Ответ на Postgre RAISE NOTICE and PHP  (Andre Lopes <lopes80andre@gmail.com>)
Ответы Re: Postgre RAISE NOTICE and PHP
Список pgsql-general
On Tue, Aug 18, 2009 at 10:57 AM, Andre Lopes<lopes80andre@gmail.com> wrote:
> Hi,
>
> I'm developing a function with some checks, for example... to check if the
> e-mail is valid or not.
>
> If the e-mail is not valid I put a line with RAISE NOTICE 'E-mail not
> valid'.
>
> I need to know if it is possible to show this RAISE NOTICE when I run this
> function from PHP.

http://www.php.net/manual/en/function.pg-last-notice.php

example plpgsql function:
create or replace function tester() returns int language plpgsql as $$
BEGIN
raise notice 'whoops';
return 1;
END
$$;

example php:
<?php
$conn = pg_connect("dbname=smarlowe");
$res = pg_query("select tester()");
print pg_last_notice($conn);
print "\n";
?>

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Any justification for sequence table vs. native sequences?
Следующее
От: Andre Lopes
Дата:
Сообщение: Access Control System - Design