Mega Code Archive

 
Categories / PostgreSQL / Insert Delete Update
 

Fill the columns from the left with as many values as are given, and the rest will be defaulted

postgres=# postgres=# postgres=# CREATE TABLE products ( postgres(#    product_no integer, postgres(#    name text, postgres(#    price numeric postgres(# ); CREATE TABLE postgres=# -- Fill the columns from the left with as many values as are given, and the rest will be defaulted. postgres=# INSERT INTO products VALUES (1, 'Cheese'); INSERT 0 1 postgres=# postgres=# postgres=# select * from products;  product_no |  name  | price ------------+--------+-------           1 | Cheese | (1 row) postgres=# postgres=# drop table products; DROP TABLE postgres=# postgres=# postgres=#