Re: PDO PgSQL: _pdo_pgsql_notice
| From: | Matteo Beccati | Date: | Wed, 07 Oct 2009 06:05:31 +0000 |
| Subject: | Re: PDO PgSQL: _pdo_pgsql_notice | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45678@lists.php.net to get a copy of this message | ||
Hi Christopher,
> What are notices? Do they relate anything in other Databases?
> I.e. can a generic interface be implemented instead of a postgres
> specific one?
I'm not sure. Notices are non-error messages that can be triggered
during a query for informative purposes. For example CREATE TABLE
triggers some notices when sequences or indexes are automatically created:
test=# create table foo (id serial not null primary key);
NOTICE: CREATE TABLE will create implicit sequence "foo_id_seq" for
serial column "foo.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"foo_pkey" for table "foo"
CREATE TABLE
or they can be raised during a function call:
test=# CREATE FUNCTION foo() RETURNS void AS $_$DECLARE i int; BEGIN FOR
i IN 1..3 LOOP RAISE NOTICE 'i = %', i; END LOOP; END;$_$ LANGUAGE plpgsql;
CREATE FUNCTION
test=# SELECT foo();
NOTICE: i = 1
NOTICE: i = 2
NOTICE: i = 3
foo
-----
(1 row)
On PostgreSQL they require a special handler to be set to catch them,
but the default behaviour would be to ignore them because they are
usually not particularly interesting.
Cheers
--
Matteo Beccati