<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-02-27 16:15 GMT+01:00 Tomek Mrugalski <span dir="ltr"><<a href="mailto:tomasz@isc.org" target="_blank">tomasz@isc.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 02/27/18 15:38, Stéphane Klein wrote:<br>
> Do you have example how to insert properly my host in Kea PostgreSQL<br>
> database?<br>
</span>Have you read this <a href="http://kea.isc.org/wiki/HostReservationsHowTo" rel="noreferrer" target="_blank">http://kea.isc.org/wiki/<wbr>HostReservationsHowTo</a>?<br>
<br></blockquote><div><br></div><div>Thanks<br><br></div><div>I have written:<br></div><br>DELETE FROM hosts;<br><br>INSERT INTO hosts (<br> dhcp_identifier,<br> dhcp_identifier_type,<br> dhcp4_subnet_id,<br> ipv4_address,<br> hostname,<br> dhcp4_next_server,<br> dhcp4_server_hostname,<br> dhcp4_boot_file_name<br>)<br><br>VALUES (<br> DECODE(REPLACE('08-00-27-8e-15-8a', '-', ''), 'hex'),<br> (SELECT type FROM host_identifier_type WHERE name='hw-address'),<br> 1,<br> (SELECT ('192.168.0.11'::inet - '0.0.0.0'::inet)),<br> 'blank_machine',<br> (SELECT ('192.168.0.254'::inet - '0.0.0.0'::inet)),<br> 'blank_machine',<br> 'pxelinux.0'<br>);<br><br>INSERT INTO hosts (<br> dhcp_identifier,<br> dhcp_identifier_type,<br> dhcp4_subnet_id,<br> ipv4_address,<br> hostname,<br> dhcp4_next_server,<br> dhcp4_server_hostname,<br> dhcp4_boot_file_name<br>)<br><br>VALUES (<br> DECODE(REPLACE('08-00-27-8e-15-8b', '-', ''), 'hex'),<br> (SELECT type FROM host_identifier_type WHERE name='hw-address'),<br> 1,<br> (SELECT ('192.168.0.12'::inet - '0.0.0.0'::inet)),<br> 'test-dhcp-server',<br> (SELECT ('192.168.0.254'::inet - '0.0.0.0'::inet)),<br> 'test-dhcp-server',<br> 'pxelinux.0'<br>);<br><br></div></div></div>