Документация PHP


pg_last_error

pg_last_oid

PostgreSQL

PHP Manual


pg_last_notice

(PHP 4 >= 4.0.6, PHP 5)

pg_last_notice — Returns the last notice message from PostgreSQL server

Описание

string pg_last_notice ( resource $connection )

pg_last_notice() returns the last notice message from the PostgreSQL server on the specified connection . The PostgreSQL server sends notice messages in several cases, for instance when creating a SERIAL column in a table.

With pg_last_notice(), you can avoid issuing useless queries by checking whether or not the notice is related to your transaction.

Notice message tracking can be set to optional by setting 1 for pgsql.ignore_notice in php.ini.

Notice message logging can be set to optional by setting 0 for pgsql.log_notice in php.ini. Unless pgsql.ignore_notice is set to 0, notice message cannot be logged.

Список параметров

connection

PostgreSQL database connection resource.

Возвращаемые значения

A string containing the last notice on the given connection , or FALSE on error.

Список изменений

Версия Описание
4.3.0 This function is now fully implemented. Earlier versions ignores database connection parameter.
4.3.0 The pgsql.ignore_notice and pgsql.log_notice php.ini directives were added.
4.0.6 PHP 4.0.6 has problem with notice message handling. Use of the PostgreSQL module with PHP 4.0.6 is not recommended even if you are not using pg_last_notice().

Примеры

Пример #1 pg_last_error() example

<?php
  $pgsql_conn 
pg_connect("dbname=mark host=localhost");
  
  
$res pg_query("CREATE TABLE test (id SERIAL)");
  
  
$notice pg_last_notice($pgsql_conn);
  
  echo 
$notice;
?>

Результат выполнения данного примера:

CREATE TABLE will create implicit sequence "test_id_seq" for "serial" column "test.id"

Смотрите также


pg_last_error

pg_last_oid

PostgreSQL

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…