磨礪技術珠磯,踐行數據之道,追求卓越價值
回到上一級頁面: PostgreSQL基礎知識與基本操作索引頁 回到頂級頁面:PostgreSQL索引頁
[作者:高健@博客園 mail: luckyjackgao@gmail.com ]
select chr(int4(random()*26)+65);
postgres=# select chr(int4(random()*26)+65); chr ----- N (1 row) postgres=# select chr(int4(random()*26)+65); chr ----- Y (1 row) postgres=# select chr(int4(random()*26)+65); chr ----- N (1 row) postgres=# select chr(int4(random()*26)+65); chr ----- C (1 row) postgres=# select chr(int4(random()*26)+65); chr ----- O (1 row) postgres=# select chr(int4(random()*26)+65); chr ----- W (1 row) postgres=#
這個功能在造自己的測試數據時很有用:
postgres=# insert into test01 values(generate_series(1,10000000),repeat( chr(int4(random()*26)+65),4)); INSERT 0 10000000 postgres=#
[作者:高健@博客園 mail: luckyjackgao@gmail.com ]
回到上一級頁面: PostgreSQL基礎知識與基本操作索引頁 回到頂級頁面:PostgreSQL索引頁
磨礪技術珠磯,踐行數據之道,追求卓越價值