D.3. A tbl2filed Example
Let's look at a complete example by continuing with the nameserver configuration for Laddie. The /etc/resolv.conf file on a running Laddie system looks like this:
nameserver 22.214.171.124 nameserver 126.96.36.199 nameserver 188.8.131.52
Our goal is to be able to read the first DNS nameserver with a SELECT statement as follows:
psql -h localhost -p 8885 > SELECT * FROM tbl2field where name = "nameserver_1"; > \q
Similarly, to modify the second DNS server, Laddie uses the following UPDATE statement:
psql -h localhost -p 8885 > UPDATE tbl2field SET value="192.168.1.1" > WHERE name=resolv AND field="nameserver_2"; > \q
You can verify the above by booting the Laddie CD, exiting from the framebuffer menu, logging in as root, ...