PostgreSQL : ชนิดของข้อมูล (Data type)

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: PostgreSQL : ชนิดของข้อมูล (Data type)

PostgreSQL : ชนิดของข้อมูล (Data type)

โดย thitikorn_lp » 17/01/2015 6:06 pm

ชนิดของข้อมูล (Data type)

  ข้อมูลที่อยู่ใน PostgreSQL ถูกกำหนดด้วยชนิดข้อมูลอ (data type) ซึ่งมีประเภทของชนิดข้อมูล (data type) จะมีหลายประเภท ดังนี้
Character types
  • Character varying(n), varchar (จำนวนตัวอักษร) : ความยาวของข้อความจำกัดตามจำนวนตัวอักษร
    Character (จำนวนตัวอักษร) , char (จำนวนตัวอักษร) : กำหนดความยาวและช่องว่าง
    text : ไม่จำกัดจำนวนตัวอักษร
Numberic types
  • smallint
    integer
    bigint
    decimal
    numeric
    real
    double precision
    serial
Date/Time types
  • timestamp without time zone : แสดงทั้งวันและเวลา
    timestamp with time zone : แสดงทั้งวันและเวลาที่มีโซนเวลา
    interval : แสดงช่วงเวลา
    date : แสดงเฉพาะวันที่
    time without time zone : แสดงเวลาของวันเท่านั้น
    time with time zone : แสดงเวลาที่มีโซนเวลา
Logical types
  • boolean(bool) : แสดงค่า TRUE, FALSE, หรือ NULL

ข้างบน