惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
G
Google Developers Blog
小众软件
小众软件
V
V2EX
月光博客
月光博客
腾讯CDC
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
D
Docker
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI

博客园 - 35号房客

从Window共享服务器上注销登陆 MDK 10.1版,简单硬盘安装法(图形界面) ORACLE_SID在Linux平台是否大小敏感?是! oracle 9i on redhat as3,应该安装的rpm start isqlplus&em of oracle 通过ftp修改帐户密码 学会将SYS_GUID和序列作为主关键字 How can I make Yahoo! Mail my default email application? Quick .Net File Download Security 如何让win XP实现自动登陆 关于yahoo邮箱如何开通POP access服务 Installing the FrontPage Hit Counter Web Bot ORACLE的启动和关闭 Install Tomcat As windows service 用vb6读写INI文件的模块 Twip&px 可能你没有注意的Exception的属性 用c#获取本机mac(通过dll调用) 答谢cnblogs.com:散两个gmail邀请
我的pg上的上,sql-server-style的new_uuid
35号房客 · 2004-10-03 · via 博客园 - 35号房客

shell里面,建立语言:
[postgres@lacl-001 /root]$createlang -d lacl plpgsql
然后到psql里面创建一个函数new-uuid():
CREATE OR REPLACE FUNCTION new_uuid()
  RETURNS text AS
'
declare
vWork1 text;
vWork2 text;
vMac text;
begin
-- replace vMac with the mac of your own box
vMac=\'00:0D:56:FD:A0:DB\';
vWork1 := md5(vMAC || now());
vWork2 := SUBSTRING(vWork1, 1, 8) ||\'-\'|| SUBSTRING(vWork1,9,4) ||\'-\'|| SUBSTRING(vWork1,13,4) ||\'-\'|| SUBSTRING(vWork1,17,4) ||\'-\'|| SUBSTRING(vWork1,21,12);
RETURN cast(vWork2 as varchar(36));
end;
'
  LANGUAGE 'plpgsql' VOLATILE;

posted on 2004-10-03 14:52  35号房客  阅读(585)  评论()    收藏  举报