Re: The sample FDW table: pglog not work in https://www.postgresql.org/docs/14/file-fdw.html - Mailing list pgsql-docs

From Masahiko Sawada
Subject Re: The sample FDW table: pglog not work in https://www.postgresql.org/docs/14/file-fdw.html
Date
Msg-id CAD21AoC1xqV2HhzZadMKg_PF0z_OXTSra7p5pgnh4ShdzPVLSQ@mail.gmail.com
Whole thread Raw
In response to The sample FDW table: pglog not work in https://www.postgresql.org/docs/14/file-fdw.html  (PG Doc comments form <noreply@postgresql.org>)
Responses Re: The sample FDW table: pglog not work in https://www.postgresql.org/docs/14/file-fdw.html
List pgsql-docs
On Wed, Aug 3, 2022 at 10:48 PM PG Doc comments form
<noreply@postgresql.org> wrote:
>
> 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.

You said you added 2 extra columns to the example in PG14 doc but both
pglog table definitions you mentioned above have the same number of
columns, 26. The first table definition worked with PG14 in my
environment. Could you try using the first example again and share the
error message if an error occurs?

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



pgsql-docs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: PostgreSQL 15 minor fixes in protocol.sgml
Next
From: "Xiong He"
Date:
Subject: Re: The sample FDW table: pglog not work in https://www.postgresql.org/docs/14/file-fdw.html