<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Database - 分类 - 招财猫的部落格</title>
        <link>https://blog.besty.day/categories/database/</link>
        <description>Database - 分类 - 招财猫的部落格</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Sun, 14 Apr 2019 15:40:23 &#43;0800</lastBuildDate><atom:link href="https://blog.besty.day/categories/database/" rel="self" type="application/rss+xml" /><item>
    <title>Greenplum TPC-H测试</title>
    <link>https://blog.besty.day/posts/2019/04/tpch-test/</link>
    <pubDate>Sun, 14 Apr 2019 15:40:23 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/04/tpch-test/</guid>
    <description><![CDATA[<p>首先从<a href="http://www.tpc.org" target="_blank" rel="noopener noreffer ">官网</a>下载TPC-H_Tools_v2.18.0.zip，解压</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ unzip TPC-H_Tools_v2.18.0.zip</span></span></code></pre></div></div>

<p>进入<code>dbgen</code>目录，拷贝Makefile</p>]]></description>
</item>
<item>
    <title>gpdb官方安装包自定义安装路径的方法</title>
    <link>https://blog.besty.day/posts/2019/04/custom_gpdb_installation/</link>
    <pubDate>Thu, 11 Apr 2019 16:38:13 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/04/custom_gpdb_installation/</guid>
    <description><![CDATA[<p>下载安装包并解压，得到一个bin文件，从bin文件提取rpm文件</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># 前960行为安装脚本</span>
</span></span><span class="line"><span class="cl"><span class="o">[</span>root@hadoop2 ~<span class="o">]</span><span class="c1"># tail -n +961 greenplum-db-5.16.0-rhel7-x86_64.bin &gt; gpdb.tar.gz</span></span></span></code></pre></div></div>

<p>如果集群没有gpadmin用户，可以利用<code>gpssh</code>批量创建gpadmin用户。首先以root用户登陆master节点，解压gpdb.tar.gz：</p>]]></description>
</item>
<item>
    <title>PostgreSQL数据类型</title>
    <link>https://blog.besty.day/posts/2019/01/postgres_data_type/</link>
    <pubDate>Tue, 22 Jan 2019 16:20:20 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/01/postgres_data_type/</guid>
    <description><![CDATA[<h2 id="类型介绍">类型介绍</h2>
<h3 id="类型分类">类型分类</h3>
<p>PostgreSQL支持的数据类型分类如表：</p>
<table>
  <thead>
      <tr>
          <th>类型</th>
          <th>说明</th>
          <th>对比其他数据库</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>布尔类型</td>
          <td>PostgreSQL支持SQL标准的boolean数据类型</td>
          <td>与MySQL的BOOL、BOOLEAN类型相同，使用一字节存储空间</td>
      </tr>
      <tr>
          <td>数值类型</td>
          <td>整数类型有2字节的smallint、4字节的int、8字节的bigint，十进制精确类型有numeric，浮点类型有real和double precision。还有8字节的货币(money)类型</td>
          <td>无MySQL的unsigned整数类型，也无MySQL 1字节长的tinyint整数类型和3字节长的medium int整数类型</td>
      </tr>
      <tr>
          <td>字符类型</td>
          <td>有varchar(n)、char(n)、text三种类型</td>
          <td>PostgreSQL中的varchar(n)最大可以存储1GB，而MySQL中的varchar(n)最大只能是64KB。PostgreSQL中的text类型相当于MySQL中的LONGTEXT类型</td>
      </tr>
      <tr>
          <td>二进制数据类型</td>
          <td>只有一种bytea</td>
          <td>对应MySQL的BLOB和LONGBLOB类型</td>
      </tr>
      <tr>
          <td>位串类型</td>
          <td>位串就是一串1和0的字符串，有bit(n)、bit varying(n)两种</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>日期和时间类型</td>
          <td>有date、time、timestamp，而time和timestamp又分是否包括时区的两种类型</td>
          <td>在PostgreSQL中，可以精确到秒以下，如毫秒。而MySQL的时间类型最多只能精确到秒，其日期时间的范围也与MySQL差异较大</td>
      </tr>
      <tr>
          <td>枚举类型</td>
          <td>枚举类型是一种包含一系列有序静态值集合的数据类型，等于某些编程语言中的enum类型</td>
          <td>PostgreSQL使用枚举类型前需要先使用CREATE TYPE创建这个类型。MySQL也有枚举类型(ENUM)</td>
      </tr>
      <tr>
          <td>几何类型</td>
          <td>包括了点(point)、直线(line)、线段(lseg)、路径(path)、多边形(polygon)、圆(cycle)等类型</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>网络地址类型</td>
          <td>有cidr、inet、macaddr三种类型</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>数组类型</td>
          <td>可以存储一个数组</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>复合类型</td>
          <td>可以把已有的简单类型组合成用户自定义的类型，就如C语言中的结构体一样</td>
          <td>对应其他数据库的自定义类型</td>
      </tr>
      <tr>
          <td>xml类型</td>
          <td>可以存储XML数据的类型</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>json类型</td>
          <td>可以存储json类型的数据</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>range类型</td>
          <td>可以存储范围数据</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>对象标识符类型</td>
          <td>PostgreSQL内部标识对象的类型，如oid类型、regproc类型、regclass类型等</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>伪类型</td>
          <td>伪类型不能作为字段的数据类型，但是它可以用于声明一个函数的参数或者结果类型。有any、anyarray、anyelement、cstring、internal、language_handler、record、trigger、void、opaque</td>
          <td>N/A</td>
      </tr>
      <tr>
          <td>其他类型</td>
          <td>一些不好分类的类型都放到这里，如UUID类型、pg_Isn类型</td>
          <td>N/A</td>
      </tr>
  </tbody>
</table>
<p>为了提高SQL的兼容性，部分类型还有很多别名。</p>]]></description>
</item>
<item>
    <title>psql使用介绍</title>
    <link>https://blog.besty.day/posts/2019/01/psql_intro/</link>
    <pubDate>Sat, 19 Jan 2019 19:13:20 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/01/psql_intro/</guid>
    <description><![CDATA[<h2 id="psql介绍">psql介绍</h2>
<p><code>psql</code>是PostgreSQL中的一个命令行交互式客户端工具，类似Oracle中的命令行工具<code>sqlplus</code>，但它使用起来远比<code>sqlplus</code>方便。</p>]]></description>
</item>
<item>
    <title>SQL入门</title>
    <link>https://blog.besty.day/posts/2019/01/sql_intro/</link>
    <pubDate>Sat, 19 Jan 2019 19:13:04 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/01/sql_intro/</guid>
    <description><![CDATA[<h2 id="sql语句分类">SQL语句分类</h2>
<ul>
<li>DQL(Data Query Language)：数据查询语言，基本就是<code>select</code>语句，用于数据查询。</li>
<li>DML(Data Manipulation Language)：数据操纵语言，包含<code>insert</code>、<code>update</code>、<code>delete</code>三种语句。</li>
<li>DDL(Data Definition Language)：数据定义语言，主要用于创建、删除或修改表、索引等数据库对象。</li>
</ul>
<h2 id="创建表create-table">创建表(create table)</h2>
<p>使用<code>\h create table</code>查看帮助</p>]]></description>
</item>
<item>
    <title>Docker安装gpdb测试数据库</title>
    <link>https://blog.besty.day/posts/2019/01/docker_install_gpdb_dev_env/</link>
    <pubDate>Thu, 17 Jan 2019 15:02:33 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2019/01/docker_install_gpdb_dev_env/</guid>
    <description><![CDATA[<p><strong>下载gpdb-dev镜像</strong></p>
<p><code>pivotaldata/gpdb-dev:centos7</code>是官方的开发镜像，里面已经装好了一些依赖，所以使用起来会方便一点。</p>]]></description>
</item>
<item>
    <title>docker安装greenplum集群</title>
    <link>https://blog.besty.day/posts/2018/08/install-greenplum-in-docker/</link>
    <pubDate>Tue, 21 Aug 2018 19:15:14 &#43;0800</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2018/08/install-greenplum-in-docker/</guid>
    <description><![CDATA[<p>本文参考<a href="https://my.oschina.net/u/876354/blog/1606419" target="_blank" rel="noopener noreffer ">这里</a>安装greenplum成功，并记录一下过程</p>
<h2 id="创建docker节点">创建docker节点</h2>
<p>拉取centos镜像</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="o">[</span>xiaoyu@xiaoyu ~<span class="o">]</span>$ docker pull centos</span></span></code></pre></div></div>

<p>创建几个容器，作为greenplum的节点</p>]]></description>
</item>
<item>
    <title>MySQL Cookbook 第5章 处理字符串</title>
    <link>https://blog.besty.day/posts/2016/04/mysql-cookbook-5/</link>
    <pubDate>Thu, 07 Apr 2016 22:45:02 &#43;0000</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2016/04/mysql-cookbook-5/</guid>
    <description><![CDATA[<h1 id="50-introduction">5.0. Introduction</h1>
<ul>
<li>A string can be binary or nonbinary. Binary strings are used for raw data such as
images, music files, or encrypted values. Nonbinary strings are used for character
data such as text and are associated with a character set and collation (sort order).</li>
<li>A character set determines which characters are legal in a string. You can choose
collations according to whether you need comparisons to be case sensitive or case
insensitive, or to use the rules of a particular language.</li>
<li>Data types for binary strings are BINARY, VARBINARY, and BLOB. Data types for
nonbinary strings are CHAR, VARCHAR, and TEXT, each of which permits CHARACTER
SET and COLLATE attributes.</li>
<li>You can convert a binary string to a nonbinary string and vice versa, or convert a
nonbinary string from one character set or collation to another.</li>
<li>You can use a string in its entirety or extract substrings from it. Strings can be
combined with other strings.</li>
<li>You can apply pattern-matching operations to strings.</li>
<li>Full-text searching is available for efficient queries on large collections of text.</li>
</ul>
<h1 id="51-string-properties">5.1. String Properties</h1>
<p>One string property is whether it is binary or nonbinary:</p>]]></description>
</item>
<item>
    <title>MySQL Cookbook 第4章 表管理</title>
    <link>https://blog.besty.day/posts/2016/04/mysql-cookbook-4/</link>
    <pubDate>Thu, 07 Apr 2016 21:19:39 &#43;0000</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2016/04/mysql-cookbook-4/</guid>
    <description><![CDATA[<h1 id="40-introduction">4.0. Introduction</h1>
<p>This chapter covers topics that relate to creating and populating tables:
• Cloning a table
• Copying from one table to another
• Using temporary tables
• Generating unique table names
• Determining what storage engine a table uses or converting it from one storage
engine to another</p>
<h1 id="41-cloning-a-table">4.1. Cloning a Table</h1>
<p>Problem</p>
<p>You want to create a table that has exactly the same structure as an existing table.</p>]]></description>
</item>
<item>
    <title>MySQL Cookbook 第3章 从表中查询数据</title>
    <link>https://blog.besty.day/posts/2016/04/mysql-cookbook-3/</link>
    <pubDate>Thu, 07 Apr 2016 12:14:29 &#43;0000</pubDate>
    <author>招财猫</author>
    <guid>https://blog.besty.day/posts/2016/04/mysql-cookbook-3/</guid>
    <description><![CDATA[<h1 id="30-介绍">3.0. 介绍</h1>
<p>本章专注使用SELECT语句从你的数据库获取信息。</p>
<h1 id="31-指定select哪行哪列">3.1. 指定SELECT哪行哪列</h1>
<p><strong>问题</strong></p>
<p>你想要从一张表中展示特定行和列。</p>
<p><strong>解决方法</strong></p>
<p>为了指示展示哪一列，在输出列表中指定它。为了指示展示哪一行，使用WHERE语句指定满足条件的行。</p>]]></description>
</item>
</channel>
</rss>
