pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: iihero@qq.com
Subject: The sample FDW table: pglog  not work in https://www.postgresql.org/docs/14/file-fdw.html
Date: Wed, 03 Aug 2022 13:29:58 +0000
Message-ID: <165953339809.43641.11613668155724201455@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/appendixes.html
Description:

Dear All, 
CREATE FOREIGN TABLE pglog (
  log_time timestamp(3) with time zone,
  user_name text,
  database_name text,
  process_id integer,
  connection_from text,
  session_id text,
  session_line_num bigint,
  command_tag text,
  session_start_time timestamp with time zone,
  virtual_transaction_id text,
  transaction_id bigint,
  error_severity text,
  sql_state_code text,
  message text,
  detail text,
  hint text,
  internal_query text,
  internal_query_pos integer,
  context text,
  query text,
  query_pos integer,
  location text,
  application_name text,
  backend_type text,
  leader_pid integer,
  query_id bigint
) SERVER pglog
OPTIONS ( filename 'log/pglog.csv', format 'csv' );

If we use pg14 as the server,  this example will not work. 
I just tried adding 2 extra columns, finally it can work.
see below:

CREATE FOREIGN TABLE pglog (
  log_time timestamp(3) with time zone,
  user_name text,
  database_name text,
  process_id integer,
  connection_from text,
  session_id text,
  session_line_num bigint,
  command_tag text,
  session_start_time timestamp with time zone,
  virtual_transaction_id text,
  transaction_id bigint,
  error_severity text,
  sql_state_code text,
  message text,
  detail text,
  hint text,
  internal_query text,
  internal_query_pos integer,
  context text,
  query text,
  bbb text,
  query_pos integer,
  location text,
  application_name text,
  backend_type text,
  ccc integer
) SERVER pglog_server
OPTIONS ( filename 'log/pglog.csv', format 'csv' );

There is a "bbb" and "ccc" to by pass the error.  In fact, it need dev of PG
to provide the valid meaningful column names there.  
Just suggest update this page to reflect the change.  Otherwise the user
will be confused why it can't work and will try to find which columns are
missing there.


view thread (3+ messages)  latest in thread

Message-ID: <165953339809.43641.11613668155724201455@wrigleys.postgresql.org>
Permalink:  ../165953339809.43641.11613668155724201455@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/165953339809.43641.11613668155724201455@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, iihero@qq.com
  Subject: Re: The sample FDW table: pglog  not work in https://www.postgresql.org/docs/14/file-fdw.html
  In-Reply-To: <165953339809.43641.11613668155724201455@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox