我正在运行9.4版的“官方”postgresql码头集装箱。我进入了运行中的容器并安装了orafce。
docker exec -i -t my_postgres bash
apt-get install postgresql-9.4-orafce之后,我尝试重新加载和重新启动postgresql服务,以及重新启动整个容器,但是当我尝试使用函数(应该在orafce中定义)时,它无法工作。
我说的是来自这里的一个简单例子
SELECT add_months(date '2005-05-31',1); -- > 2005-06-30
SELECT last_day(date '2005-05-24'); -- > 2005-05-31
SELECT next_day(date '2005-05-24', 'monday'); -- > 2005-05-30
SELECT next_day(date '2005-05-24', 2); -- > 2005-05-30
SELECT months_between(date '1995-02-02', date '1995-01-01'); -- > 1.0322580645161
SELECT trunc(date '2005-07-12', 'iw'); -- > 2005-07-11
SELECT round(date '2005-07-12', 'yyyy'); -- > 2006-01-01当简单地将这些命令复制到postgres/ phpPgAdmin /public中时,我就会得到这样的输出:
SQL error:
ERROR: function add_months(date, integer) does not exist
LINE 1: SELECT add_months(date '2005-05-31',1); -- > 2005-06-30
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
In statement:
SELECT add_months(date '2005-05-31',1); -- > 2005-06-30
SELECT last_day(date '2005-05-24'); -- > 2005-05-31
SELECT next_day(date '2005-05-24', 'monday'); -- > 2005-05-30
SELECT next_day(date '2005-05-24', 2); -- > 2005-05-30
SELECT months_between(date '1995-02-02', date '1995-01-01'); -- > 1.0322580645161
SELECT trunc(date '2005-07-12', 'iw'); -- > 2005-07-11
SELECT round(date '2005-07-12', 'yyyy'); -- > 2006-01-01现在,我知道,我不应该直接在坞内安装软件包,也不应该使用phpPgAdmin,这只是一个简单的测试,看看我是否可以将一个较小的oracle移植到postgres。
有什么东西我遗漏了才能使用orafce吗?在安装软件包或重新启动库时,我找不到任何错误。
发布于 2015-06-15 15:47:23
好吧,一杯酒
CREATE EXTENSION orafce就够了
https://stackoverflow.com/questions/30849002
复制相似问题