라이브러리

[PHP] pg_parameter_status - 서버의 현재 매개변수 설정을 조회합니다.




PHP에서 pg_parameter_status 함수

`pg_parameter_status` 함수는 PostgreSQL 데이터베이스와 연결된 PHP의 PostgreSQL 확장 함수입니다. 이 함수는 현재 데이터베이스의 특정 매개 변수의 상태를 반환합니다.

매개 변수


* `name`: 매개 변수의 이름을 지정합니다. 예를 들어, `pg_parameter_status('database', 'is_superuser')`는 현재 데이터베이스의 `is_superuser` 매개 변수의 상태를 반환합니다.

반환 값


* 매개 변수의 상태를 나타내는 문자열을 반환합니다. 예를 들어, `pg_parameter_status('database', 'is_superuser')`는 `"t"` 또는 `"f"`를 반환할 수 있습니다.

예제


# 1. 현재 데이터베이스의 `is_superuser` 매개 변수의 상태를 반환합니다.


#hostingforum.kr
php

<?php

// PostgreSQL 데이터베이스와 연결

$conn = pg_connect("host=localhost dbname=mydb user=myuser password=mypassword");



// 현재 데이터베이스의 is_superuser 매개 변수의 상태를 반환합니다.

$superuser = pg_parameter_status('database', 'is_superuser');



// 결과를 출력합니다.

echo "현재 데이터베이스의 is_superuser 매개 변수의 상태: $superuser
";



// PostgreSQL 데이터베이스와 연결을 끊습니다.

pg_close($conn);

?>



# 2. 현재 데이터베이스의 `effective_io_concurrency` 매개 변수의 상태를 반환합니다.


#hostingforum.kr
php

<?php

// PostgreSQL 데이터베이스와 연결

$conn = pg_connect("host=localhost dbname=mydb user=myuser password=mypassword");



// 현재 데이터베이스의 effective_io_concurrency 매개 변수의 상태를 반환합니다.

$io_concurrency = pg_parameter_status('database', 'effective_io_concurrency');



// 결과를 출력합니다.

echo "현재 데이터베이스의 effective_io_concurrency 매개 변수의 상태: $io_concurrency
";



// PostgreSQL 데이터베이스와 연결을 끊습니다.

pg_close($conn);

?>



참고


* `pg_parameter_status` 함수는 PostgreSQL 데이터베이스와 연결된 PHP의 PostgreSQL 확장 함수입니다.
* 이 함수는 현재 데이터베이스의 특정 매개 변수의 상태를 반환합니다.
* 매개 변수의 이름은 `name` 매개 변수에 지정합니다.
* 반환 값은 매개 변수의 상태를 나타내는 문자열입니다.
* 예제를 포함하여 `pg_parameter_status` 함수의 사용법을 설명합니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 329 페이지

검색

게시물 검색