<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL%2FArray%2FArray_Column_Insert</id>
		<title>PostgreSQL/Array/Array Column Insert - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=PostgreSQL%2FArray%2FArray_Column_Insert"/>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=PostgreSQL/Array/Array_Column_Insert&amp;action=history"/>
		<updated>2026-04-06T08:42:33Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://sqle.ru/index.php?title=PostgreSQL/Array/Array_Column_Insert&amp;diff=5010&amp;oldid=prev</id>
		<title> в 13:45, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=PostgreSQL/Array/Array_Column_Insert&amp;diff=5010&amp;oldid=prev"/>
				<updated>2010-05-26T13:45:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 13:45, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://sqle.ru/index.php?title=PostgreSQL/Array/Array_Column_Insert&amp;diff=5011&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=PostgreSQL/Array/Array_Column_Insert&amp;diff=5011&amp;oldid=prev"/>
				<updated>2010-05-26T10:14:36Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Insert array data to table==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
postgres=# CREATE TABLE arr(f1 int[], f2 int[]);&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO arr VALUES (ARRAY[[1,2],[3,4]], ARRAY[[5,6],[7,8]]);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT ARRAY[f1, f2, &amp;quot;{{9,10},{11,12}}&amp;quot;::int[]] FROM arr;&lt;br /&gt;
                     array&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
 {{{1,2},{3,4}},{{5,6},{7,8}},{{9,10},{11,12}}}&lt;br /&gt;
(1 row)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE &amp;quot;bytea%&amp;quot;);&lt;br /&gt;
                               ?column?&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
 {2011,1954,1948,1952,1951,1244,1950,2005,1949,1953,2006,31,2412,2413}&lt;br /&gt;
(1 row)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop table arr;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Insert data for two dimensional array==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE sal_emp (&lt;br /&gt;
postgres(#    name            text,&lt;br /&gt;
postgres(#    pay_by_quarter  integer[],&lt;br /&gt;
postgres(#    schedule        text[][]&lt;br /&gt;
postgres(# );&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO sal_emp&lt;br /&gt;
postgres-#    VALUES (&amp;quot;Bill&amp;quot;,&lt;br /&gt;
postgres(#    ARRAY[10000, 10000, 10000, 10000],&lt;br /&gt;
postgres(#    ARRAY[[&amp;quot;meeting&amp;quot;, &amp;quot;lunch&amp;quot;], [&amp;quot;training&amp;quot;, &amp;quot;presentation&amp;quot;]]);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO sal_emp&lt;br /&gt;
postgres-#    VALUES (&amp;quot;Carol&amp;quot;,&lt;br /&gt;
postgres(#    ARRAY[20000, 25000, 25000, 25000],&lt;br /&gt;
postgres(#    ARRAY[[&amp;quot;breakfast&amp;quot;, &amp;quot;consulting&amp;quot;], [&amp;quot;meeting&amp;quot;, &amp;quot;lunch&amp;quot;]]);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# -- An array slice is denoted by writing lower-bound:upper-bound for one or more array dimensions.&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT schedule[1:2][2] FROM sal_emp WHERE name = &amp;quot;Bill&amp;quot;;&lt;br /&gt;
                 schedule&lt;br /&gt;
-------------------------------------------&lt;br /&gt;
 {{meeting,lunch},{training,presentation}}&lt;br /&gt;
(1 row)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT * FROM sal_emp;&lt;br /&gt;
 name  |      pay_by_quarter       |                 schedule&lt;br /&gt;
-------+---------------------------+-------------------------------------------&lt;br /&gt;
 Bill  | {10000,10000,10000,10000} | {{meeting,lunch},{training,presentation}}&lt;br /&gt;
 Carol | {20000,25000,25000,25000} | {{breakfast,consulting},{meeting,lunch}}&lt;br /&gt;
(2 rows)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop table sal_emp;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Insert data for two dimensional array column==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE sal_emp (&lt;br /&gt;
postgres(#    name            text,&lt;br /&gt;
postgres(#    pay_by_quarter  integer[],&lt;br /&gt;
postgres(#    schedule        text[][]&lt;br /&gt;
postgres(# );&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO sal_emp&lt;br /&gt;
postgres-#    VALUES (&amp;quot;Bill&amp;quot;,&lt;br /&gt;
postgres(#    ARRAY[10000, 10000, 10000, 10000],&lt;br /&gt;
postgres(#    ARRAY[[&amp;quot;meeting&amp;quot;, &amp;quot;lunch&amp;quot;], [&amp;quot;training&amp;quot;, &amp;quot;presentation&amp;quot;]]);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO sal_emp&lt;br /&gt;
postgres-#    VALUES (&amp;quot;Carol&amp;quot;,&lt;br /&gt;
postgres(#    ARRAY[20000, 25000, 25000, 25000],&lt;br /&gt;
postgres(#    ARRAY[[&amp;quot;breakfast&amp;quot;, &amp;quot;consulting&amp;quot;], [&amp;quot;meeting&amp;quot;, &amp;quot;lunch&amp;quot;]]);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT * FROM sal_emp;&lt;br /&gt;
 name  |      pay_by_quarter       |                 schedule&lt;br /&gt;
-------+---------------------------+-------------------------------------------&lt;br /&gt;
 Bill  | {10000,10000,10000,10000} | {{meeting,lunch},{training,presentation}}&lt;br /&gt;
 Carol | {20000,25000,25000,25000} | {{breakfast,consulting},{meeting,lunch}}&lt;br /&gt;
(2 rows)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# SELECT * FROM sal_emp WHERE 10000 = ALL (pay_by_quarter);&lt;br /&gt;
 name |      pay_by_quarter       |                 schedule&lt;br /&gt;
------+---------------------------+-------------------------------------------&lt;br /&gt;
 Bill | {10000,10000,10000,10000} | {{meeting,lunch},{training,presentation}}&lt;br /&gt;
(1 row)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop table sal_emp;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Inserting array constants==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# -- Inserting array constants&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# CREATE TABLE book (id integer,titles text[]);&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO book VALUES (102, &amp;quot;{&amp;quot;AAA\&amp;quot;s VVVV&amp;quot;}&amp;quot;);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO book VALUES (103, &amp;quot;{&amp;quot;AAA&amp;quot;, &amp;quot;VVVV&amp;quot;}&amp;quot;);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# select * from book;&lt;br /&gt;
 id  |     titles&lt;br /&gt;
-----+----------------&lt;br /&gt;
 102 | {&amp;quot;AAA&amp;quot;s VVVV&amp;quot;}&lt;br /&gt;
 103 | {AAA,VVVV}&lt;br /&gt;
(2 rows)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop table book;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Inserting values into multidimensional arrays==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# -- Inserting values into multidimensional arrays&lt;br /&gt;
postgres=# CREATE TABLE authors (id integer,titles text[][]);&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# INSERT INTO authors&lt;br /&gt;
postgres-#              VALUES (102,&lt;br /&gt;
postgres(#              &amp;quot;{{&amp;quot;J T&amp;quot;, &amp;quot;T S&amp;quot;},&lt;br /&gt;
postgres&amp;quot;#                {&amp;quot;C D&amp;quot;, &amp;quot;G E&amp;quot;},&lt;br /&gt;
postgres&amp;quot;#                {&amp;quot;A D&amp;quot;, &amp;quot;A L&amp;quot;}}&amp;quot;);&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# select * from authors;&lt;br /&gt;
 id  |                   titles&lt;br /&gt;
-----+---------------------------------------------&lt;br /&gt;
 102 | {{&amp;quot;J T&amp;quot;,&amp;quot;T S&amp;quot;},{&amp;quot;C D&amp;quot;,&amp;quot;G E&amp;quot;},{&amp;quot;A D&amp;quot;,&amp;quot;A L&amp;quot;}}&lt;br /&gt;
(1 row)&lt;br /&gt;
postgres=#&lt;br /&gt;
postgres=# drop table authors;&lt;br /&gt;
DROP TABLE&lt;br /&gt;
postgres=#&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>