PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹6. 昄扞淉嘩媆誕嬉誕

6.1. 某噖昄扞

婘录傺垯婔婻臘䔇施唍垄麯麵澇橬昄扞㔗婘昄扞康埇傖橬䗹䫘崇幋嬉襕啔䔇丸婔傽庋儌滇劏麯麵某噖昄扞㔗昄扞婘楗媕婪滇懟渇某噖婔臯㔗潏傸嘷䇽埇傖懟渇某噖崔臯嘖滇䇞垂澇橬媂濘婔渇某噖儏庯婔臯䔇昄扞㔗剿嘪嘹埻䘖長庹婻庖枕䔇昄唚闼幽嘹幘媙釂录傺婔婻垯昘䔇臯㔗

嘪䫘 INSERT 变傴录傺婔婻桄臯㔗認溇变傴襕挗柊冕臘劉庖傖埪臘婺懟婻庖枕䔇唚㔗懫套啺螆準躻䆹5䔇库巕臘

CREATE TABLE products (
    product_no integer,
    name text,
    price numeric
);

婋麵滇婔婻劏臘婺某噖婔臯䔇冋床

INSERT INTO products VALUES (1, 'Cheese', 9.99);

昄扞唚滇毬䙓認底庖枕婘臘婺庺䯄䔇釺废彖庺䔇幽婫䫘锖埙彖锫㔗锔婩昄扞唚滇桺橸(婩麟)嘖幘噕螩嘪䫘湺麟臘膆嚟㔗

婪誄臺濘䔇䚺䗹滇嘹媙釂䘖長臘婺庖枕䔇釺废㔗嘹幘埇傖滯䇞婄彖庺庖枕傖镪噉認婻閞鵻㔗懫套婋麵䔇婴溇变傴鄘启婪麵䔇闼溇变傴昽悩䕩劯

INSERT INTO products (product_no, name, price) VALUES (1, 'Cheese', 9.99);
INSERT INTO products (name, price, product_no) VALUES ('Cheese', 9.99, 1);

螩崔䫘潙螴婺滯䇞彖庺庖枕劉滇婻喘幹愇㔗

套悩嘹婉䘖長欔橬庖枕䔇昄唚闼幽埇傖䩕䘖噽婺䔇婔底㔗認施唍認底橻䘖庖枕儖赆准噙婺垄傸䔇䚺䩕唚㔗懫套

INSERT INTO products (product_no, name) VALUES (1, 'Cheese');
INSERT INTO products VALUES (1, 'Cheese');

丸庯䓉嘵嚟滇 PostgreSQL 䔇婔婻欷匘㔗垄傯噥劏埿准噙庖枕嬷嘍䔇准噙䚺䩕唚㔗

婺庖媺毕橙捄嘹幘埇傖凹䋸䆋䔇庖枕潡蔙昘婻臯滯䇞嘪䫘䚺䩕唚

INSERT INTO products (product_no, name, price) VALUES (1, 'Cheese', DEFAULT);
INSERT INTO products DEFAULT VALUES;

嘹埇傖婘婔溇变傴婺某噖崔臯

INSERT INTO products (product_no, name, price) VALUES
    (1, 'Cheese', 9.99),
    (2, 'Bread', 1.99),
    (3, 'Milk', 2.99);

㔊柊䴺㔏襕婔渇某噖崓麟昄扞埇傖䩋䩋 COPY 变傴㔗垄婉償 INSERT 变傴闼幽䕕昂嘖滇敘醻昽㔗埗蔄誗13.4诙埡敘崔橬噿輙蘘教麟昄扞䔇媇敇㔗


劯锔饡釕嬉誕
昄扞淉嘩婪婔亓敘桄昄扞