相关疑难解决方法(0)

在Postgres中为Insert语句生成UUID?

我的问题很简单.我知道UUID的概念,我想生成一个从我的DB中的'store'引用每个'item'.看似合理吧?

问题是以下行返回错误:

honeydb=# insert into items values(
uuid_generate_v4(), 54.321, 31, 'desc 1', 31.94);
ERROR:  function uuid_generate_v4() does not exist
LINE 2: uuid_generate_v4(), 54.321, 31, 'desc 1', 31.94);
        ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)

我已经阅读了以下网页:http://www.postgresql.org/docs/current/static/uuid-ossp.html

在此输入图像描述

我在Ubuntu 10.04 x64上运行Postgres 8.4.

postgresql uuid postgresql-8.4

318
推荐指数
9
解决办法
29万
查看次数

函数 min(uuid) 在 postgresql 中不存在

我已经使用 sqoop 从 Postgres 导入表到 hdfs。我的表有 uuid 字段作为主键,我的命令 sqoop 如下:

sqoop import --connect 'jdbc:postgresql://localhost:5432/mydb' --username postgreuser --password 123456abcA --driver org.postgresql.Driver --table users --map-column-java id=String --target-dir /hdfs/postgre/users --as-avrodatafile --compress -m 2
Run Code Online (Sandbox Code Playgroud)

但我得到了错误:

Import failed: java.io.IOException: org.postgresql.util.PSQLException: ERROR: function min(uuid) does not exist
Run Code Online (Sandbox Code Playgroud)

我尝试执行 sql 命令:SELECT min(id) from users并得到相同的错误。我怎么能修好呢?我使用 Postgres 9.4、hadoop 2.9.0 和 sqoop 1.4.7

postgresql sqoop

7
推荐指数
2
解决办法
7081
查看次数

标签 统计

postgresql ×2

postgresql-8.4 ×1

sqoop ×1

uuid ×1