On Tue, Aug 18, 2009 at 10:57 AM, Andre Lopes<lopes80an...@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";
?>

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to