如何将PostgreSQL表导出为HTML?

时间:2009-05-27 03:48:32

标签: postgresql

如何将PostgreSQL表保存为HTML?

2 个答案:

答案 0 :(得分:10)

我会假装你的意思。在psql中:

dbname=# \H
dbname=# \d tablename

答案 1 :(得分:2)

以下是XML“forest”的示例:

SELECT xmlforest (
  "FirstName" as "FName", "LastName" as "LName",
  ’string’ as "str", "Title", "Region" )
FROM "Demo"."demo"."Employees";

对于employees表中的一些数据,可能会导致:

<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