<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Forum PostgreSQL - Insert INTO]]></title>
		<link>https://forum.postgresql.org.pl/viewtopic.php?id=1227</link>
		<description><![CDATA[Najświeższe odpowiedzi w Insert INTO.]]></description>
		<lastBuildDate>Tue, 14 Feb 2012 17:38:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Odp: Insert INTO]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3431#p3431</link>
			<description><![CDATA[Tabela zawiera tylko jedną kolumnę typu serial (czyli integer + sekwencja) w dodatku określoną jako klucz główny (btw nie trzeba dodawać explicite NOT NULL przy id, sam klucz to gwarantuje). Przy insercie można podać default values tzn.:

[code]Insert Into customer Default Values;[/code]

Jeśli dodatkowo przydzielone id ma zostać zwrócone, to wystarczy dodac returning tj.:

[code]Insert Into customer Default Values Returning id;[/code]

[url]http://www.postgresql.org/docs/current/static/sql-insert.html[/url]]]></description>
			<author><![CDATA[dummy@example.com (gszpetkowski)]]></author>
			<pubDate>Tue, 14 Feb 2012 17:38:29 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3431#p3431</guid>
		</item>
		<item>
			<title><![CDATA[Insert INTO]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3430#p3430</link>
			<description><![CDATA[Mam tabele 

CREATE TABLE customer (
  id serial NOT NULL,
  CONSTRAINT customer_pkey PRIMARY KEY (id)
)

Jak wprowadzić pusty rekord , żeby postgres zwrócił unikalne id.
Polecenie 
insert into customer (id) values (''); 
zwraca błąd 
ERROR:  invalid input syntax for integer: ""
LINIA 1: insert into customer (id) values ('');
                                                                          ^

Z góry dziękuje za pomoc]]></description>
			<author><![CDATA[dummy@example.com (costy)]]></author>
			<pubDate>Tue, 14 Feb 2012 16:03:25 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3430#p3430</guid>
		</item>
	</channel>
</rss>
