skull
skull

Reputation:

How can I export a PostgreSQL table to HTML?

How can I save a PostgreSQL table to HTML?

Upvotes: 5

Views: 5102

Answers (2)

Gary Chambers
Gary Chambers

Reputation: 1267

I'll take a stab at assuming what you mean. In psql:

dbname=# \H
dbname=# \d tablename

Upvotes: 12

Robert Harvey
Robert Harvey

Reputation: 180777

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>

http://wiki.postgresql.org/wiki/XML_Support

Upvotes: 2

Related Questions