database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 2420 게시물 읽기
No. 2420
Re: create function 에 대해 조언 부탁드립니다.
작성자
정재익
작성일
2001-03-14 21:44
조회수
4,427

create function 중 internal 이라는 language 로서 함수를 만드는 것은 'postgres' 라는 superuser 만이 가능합니다. 그리고 internal 이라고 하는 것은 PostgreSQL 에서 기본적으로 제공되는 언어로 등록되어 있으며(SQL, internal, C 라는 세가지 언어가 등록되어 있습니다) 실제로 어떤 language compiler 를 가지는 것은 아닙니다. 단지 내부적으로 이용하기 위한 목적으로 생성되어 있습니다. 이 Internal 이라는 언어로 함수를 선언하기 위해서는 반드시 DB 의 superuser 권한을 가져야만이 가능합니다. 참고하시기 바랍니다.

참고로 선언한 언어의 사용법 예제를 알고 싶으면 다음 글과 댓글을 참조하시기 바랍니다.

 

http://database.sarang.net/board/dbdata.php3?table=dbdata&action=article&arg=240

 

>>이승현 님께서 쓰시길<<

 

:: CREATE FUNCTION abstime_datetime(int4)

:: RETURNS datetime

:: AS '/' LANGUAGE 'internal';

::

:: CREATE FUNCTION datetime(int4)

:: RETURNS datetime

:: AS 'select abstime_datetime($1)' LANGUAGE 'SQL';

::

:: CREATE FUNCTION reltime_timespan(int4)

:: RETURNS timespan

:: AS '/' LANGUAGE 'internal';

::

:: CREATE FUNCTION timespan(int4)

:: RETURNS timespan

:: AS 'select reltime_timespan($1)' LANGUAGE 'SQL';

::

::

:: 라는 function에 대해 잘 모르겠습니다.

:: 막상 function를 만들려고 하면 에러가 납니다.

::

::

:: psql:/usr/local/postgresql/7.0.2/contrib/unixdate/unixdate.sql:21: ERROR:

:: Only users with Postgres superuser privilege are permitted to create a

:: function in the 'internal' language. Others may use the 'sql' language or

:: the created procedural languages.

:: psql:/usr/local/postgresql/7.0.2/contrib/unixdate/unixdate.sql:25: ERROR:

:: Function 'abstime_datetime(int4)' does not exist

:: Unable to identify a function that satisfies the given argument types

:: You may need to add explicit typecasts

:: psql:/usr/local/postgresql/7.0.2/contrib/unixdate/unixdate.sql:29: ERROR:

:: Only users with Postg

:: res superuser privilege are permitted to create a function in

:: the 'internal' language. Others may use the 'sql' language or the created

:: procedural languages.

:: psql:/usr/local/postgresql/7.0.2/contrib/unixdate/unixdate.sql:33: ERROR:

:: Function 'reltime_tim

:: espan(int4)' does not exist

:: Unable to identify a function that satisfies the given argument types

:: You may need to add explicit typecasts

::

::

:: 그리고 function을 만들고 나서 어떻게 사용하는 건지도 잘모르겠습니다.

:: 조언 부탁드립니다.

::

[Top]
No.
제목
작성자
작성일
조회
2424[질문]포스트그레스 설치시 에러에 대한 질문입니다.
홍창균
2001-03-15
5596
2432┕>Re: [질문]포스트그레스 설치시 에러에 대한 질문입니다.
정재익
2001-03-16 09:58:44
5394
2423postgresql 과 oracle
미소
2001-03-15
4450
2426┕>Re: postgresql 과 oracle
정재익
2001-03-15 14:35:57
4649
2422[질문]옵션 변경 또는 언인스톨 방법 좀...
맹주형
2001-03-15
4297
2425┕>Re: [질문]옵션 변경 또는 언인스톨 방법 좀...
정재익
2001-03-15 14:16:56
4657
2427 ┕>Re: Re: 지우고 다시 깔아서 해결 ^^;;;
맹주형
2001-03-15 17:54:50
4672
2419create function 에 대해 조언 부탁드립니다.
이승현
2001-03-14
4147
2420┕>Re: create function 에 대해 조언 부탁드립니다.
정재익
2001-03-14 21:44:23
4427
2421 ┕>빠른 답변 감사합니다..
이승현
2001-03-14 21:45:04
3977
2416Postgres connection 질문있는데요.
이명진
2001-03-14
3452
2418┕>Re: Postgres connection 질문있는데요.
정재익
2001-03-14 08:09:47
4012
2415허거~ 님들 급한일이 생겼어요~
이태웅
2001-03-13
3459
2417┕>Re: 허거~ 님들 급한일이 생겼어요~
정재익
2001-03-14 08:08:29
3687
2413tuple조정하려고 config.h수정하고 ./configure해보니...
spanky
2001-03-12
3562
2414┕>Re: tuple조정하려고 config.h수정하고 ./configure해보니...
nogadax
2001-03-12 18:05:41
3593
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다