How can I save a PostgreSQL table to HTML?
+1
A:
Here is an example of an XML "forest":
SELECT xmlforest (
"FirstName" as "FName", "LastName" as "LName",
’string’ as "str", "Title", "Region" )
FROM "Demo"."demo"."Employees";
With some data in the employees table, this might result in:
<FName>Nancy</FName>
<LName>Davolio</LName>
<str>string</str>
<Title>Sales Representative</Title>
<Region>WA</Region>
...
<FName>Anne</FName>
<LName>Dodsworth</LName>
<str>string</str>
<Title>Sales Representative</Title>
Robert Harvey
2009-05-27 03:52:12
He said /HTML/, which is a significantly harder problem.
Matthew Flaschen
2009-05-27 03:59:43
+6
A:
I'll take a stab at assuming what you mean. In psql:
dbname=# \H dbname=# \d tablename
Gary Chambers
2009-05-27 04:24:46
or possibly if you want the data, then \H followed by a select statement. The key point is that the \H command (or the -H or --html command line options) in psql turn on "html output mode".
Stobor
2009-05-27 04:39:03