How to export a PostgreSQL table to HTML?

How to save a PostgreSQL table in HTML?

+3
source share
2 answers

I'll take a hit, assuming what you mean. In psql:

dbname = # \ H
dbname = # \ d tablename
+10
source

Here is an example of an XML forest:

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

With some data in the employee table, this can lead to:

<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

+2
source

Source: https://habr.com/ru/post/1709149/


All Articles