标签: postgresql-extensions

3
推荐指数
1
解决办法
2233
查看次数

Postgres C 扩展中的环境变量

我无法在 PostgreSQL C 扩展代码中获取环境变量。

例如,此函数始终返回111

#include "postgres.h"
#include "fmgr.h"
#include <stdlib.h>

PG_MODULE_MAGIC;

PG_FUNCTION_INFO_V1(myinc);
Datum
myinc(PG_FUNCTION_ARGS)
{
  int32 arg = PG_GETARG_INT32(0);
  char* envar = getenv("MYINC");
  if (envar) {
    PG_RETURN_INT32(arg + atoi(envar));
  } else {
    PG_RETURN_INT32(111);
  }
}
Run Code Online (Sandbox Code Playgroud)

虽然此 C 程序按预期工作,但它会打印以下内容MYINC

#include <stdio.h>
#include <stdlib.h>

int main()
{
  printf("MYINC: %s", getenv("MYINC"));
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

postgresql environment-variables postgresql-extensions c

2
推荐指数
1
解决办法
463
查看次数

是否可以将 Postgres 扩展添加到 AWS Aurora?

我正在尝试对 Postgres 数据库进行未来验证,以便将其转移到 AWS Aurora。

我正在使用指南扩展名uuid-ossp

是否可以向 AWS Aurora 添加 PostGres 扩展?

我特别感兴趣的是该扩展是否uuid-ossp可以在 Aurora 中使用。

postgresql postgresql-extensions amazon-rds-aurora

0
推荐指数
1
解决办法
2549
查看次数

索引条件lower(f) LIKE '%foo%'

如何使用非锚定搜索模式索引以下语句

SELECT somefield
FROM sometable 
WHERE lower(somefield2) like '%foo%';
Run Code Online (Sandbox Code Playgroud)

有些行有超过 2k 字节。

postgresql index postgresql-extensions

-1
推荐指数
1
解决办法
201
查看次数