Обсуждение: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

Поиск
Список
Период
Сортировка

BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
PG Bug reporting form
Дата:
The following bug has been logged on the website:

Bug reference:      15881
Logged by:          Cliff Campo
Email address:      cc@cj3.cc
PostgreSQL version: 12beta2
Operating system:   Mac OS X  10.13.6
Description:

Using the 12beta2 version of postgres, the following error occurs:
LocalWeather=# \dS+ pg_stats 
ERROR:  column c.relhasoids does not exist
LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi...

              ^
                             OR
LocalWeather=# \d+ pg_stats
ERROR:  column c.relhasoids does not exist
LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi...

              ^
                          OR
LocalWeather=# \d pg_stats
ERROR:  column c.relhasoids does not exist
LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi...

              ^
                         OR
LocalWeather=# \dS pg_stats
ERROR:  column c.relhasoids does not exist
LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi...

             ^
HOWEVER,
\d without specifying a table name works as expected.

AND, this problem does NOT occur on any of the previous versions (Postgres
10.4, 9.5.17, and 9.6.10) of postgres on my Mac OS X system.

Cliff Campo
cc@cj3.cc
610-389-4972 (cell)


Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
Sergei Kornilov
Дата:
Hello

Thank you for report. Can you verify you using psql version 12beta2? You see message like this:

> ./psql 
> psql (12beta2)
> Type "help" for help.
> 
> postgres=#

For example "\d pg_stats" works for me in this case

Or something like:

> psql (11.4 (Debian 11.4-1.pgdg100+1), server 12beta2)
> WARNING: psql major version 11, server major version 12.
>          Some psql features might not work.
> Type "help" for help.
>
> postgres=#

Older psql version should give such error, this is expected and we write warning about it.

regards, Sergei



Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
c Campo
Дата:
Sergei Kornilov,
Here is how I configured 12beta2:

LocalWeather=# SELECT * FROM pg_config;
       name        |

                           setting

                                          
 

-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 BINDIR            | /usr/local/pgsql12beta2/pgsql12beta2/bin
 DOCDIR            | /usr/local/pgsql12beta2/pgsql12beta2/share/doc
 HTMLDIR           | /usr/local/pgsql12beta2/pgsql12beta2/share/doc
 INCLUDEDIR        | /usr/local/pgsql12beta2/pgsql12beta2/include
 PKGINCLUDEDIR     | /usr/local/pgsql12beta2/pgsql12beta2/include
 INCLUDEDIR-SERVER | /usr/local/pgsql12beta2/pgsql12beta2/include/server
 LIBDIR            | /usr/local/pgsql12beta2/pgsql12beta2/lib
 PKGLIBDIR         | /usr/local/pgsql12beta2/pgsql12beta2/lib
 LOCALEDIR         | /usr/local/pgsql12beta2/pgsql12beta2/share/locale
 MANDIR            | /usr/local/pgsql12beta2/pgsql12beta2/share/man
 SHAREDIR          | /usr/local/pgsql12beta2/pgsql12beta2/share
 SYSCONFDIR        | /usr/local/pgsql12beta2/pgsql12beta2/etc
 PGXS              | /usr/local/pgsql12beta2/pgsql12beta2/lib/pgxs/src/makefiles/pgxs.mk
 CONFIGURE         | '--prefix=/usr/local/pgsql12beta2/pgsql12beta2'
'--exec-prefix=/usr/local/pgsql12beta2/pgsql12beta2''--with-perl' '--with-python' '--with-pgport=5442' '--with-bonjour'
'--enable-debug''--with-tcl' '--with-tclconfig=/Library/Frameworks/Tcl.framework/Versions/8.6' '--with-openssl'
'--with-includes=/usr/local/include/openssl'
'--with-libraries=/usr/libssl.dylib:/usr/lib/libapple_crypto.dylib:/usr/local/lib/libcrypto.a'
'LDFLAGS=-L/usr/local/opt/openssl/lib''CPPFLAGS=-I/usr/local/opt/openssl/include'
 
 CC                | gcc
 CPPFLAGS          | -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-I/usr/local/opt/openssl/include-I/usr/local/include/openssl
 
 CFLAGS            | -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla
-Wendif-labels-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument-g -O2
 
 CFLAGS_SL         | 
 LDFLAGS           | -L/usr/local/opt/openssl/lib -Wl,-dead_strip_dylibs
 LDFLAGS_EX        | 
 LDFLAGS_SL        | 
 LIBS              | -lpgcommon -lpgport -lssl -lcrypto -lz -lreadline -lm 
 VERSION           | PostgreSQL 12beta2
(23 rows)

Note the VERSION is PostgreSQL 12beta2.
Regards,
Cliff Campo
> On June 28, 2019 at 7:38 AM Sergei Kornilov <sk@zsrv.org> wrote:
> 
> 
> Hello
> 
> Thank you for report. Can you verify you using psql version 12beta2? You see message like this:
> 
> > ./psql 
> > psql (12beta2)
> > Type "help" for help.
> > 
> > postgres=#
> 
> For example "\d pg_stats" works for me in this case
> 
> Or something like:
> 
> > psql (11.4 (Debian 11.4-1.pgdg100+1), server 12beta2)
> > WARNING: psql major version 11, server major version 12.
> >          Some psql features might not work.
> > Type "help" for help.
> >
> > postgres=#
> 
> Older psql version should give such error, this is expected and we write warning about it.
> 
> regards, Sergei



Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
Sergei Kornilov
Дата:
Hi

I am not asking about the postgresql server. I am asking about the psql version (client). Do you run psql from
/usr/local/pgsql12beta2/pgsql12beta2/bin/psql?
 

regards, Sergei



Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
c Campo
Дата:
Also, Sergei,
This problem seems related to connecting using an older version (9.6.10) of PostgreSQL, then doing a connect to 12beta2
via\c - - - 5442
 

wren:~ cjc$ psql -U cjc -p 5436 LocalWeather
psql (9.6.10)
Type "help" for help.

LocalWeather=# \c - - - 5442
psql (9.6.10, server 12beta2)
WARNING: psql major version 9.6, server major version 12.
         Some psql features might not work.
You are now connected to database "LocalWeather" as user "cjc" via socket in "/tmp" at port "5442".
LocalWeather=# \dS+ pg_config
ERROR:  column c.relhasoids does not exist
LINE 1: ...riggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoi... 


When I use the 12beta2 version of psql the problem doesn't seem occur:

wren:~ cjc$ /usr/local/pgsql12beta2/pgsql12beta2/bin/psql -U cjc -p 5442 LocalWeather
psql (12beta2)
Type "help" for help.

LocalWeather=# \dS+ pg_config
                       View "pg_catalog.pg_config"
 Column  | Type | Collation | Nullable | Default | Storage  | Description 
---------+------+-----------+----------+---------+----------+-------------
 name    | text |           |          |         | extended | 
 setting | text |           |          |         | extended | 
View definition:
 SELECT pg_config.name,
    pg_config.setting
   FROM pg_config() pg_config(name, setting);

I don't know what postgres intends to use older versions of psql to connect to version 12; if postgres intends with
RELEASEversion 12 to only use version 12 of psql to connect to the version 12 postgres, then postgres is ok; if not,
thenthere is a problem. If the intension is the former, then documentation should state so. 
 
Best,
cjc

> On June 28, 2019 at 7:38 AM Sergei Kornilov <sk@zsrv.org> wrote:
> 
> 
> Hello
> 
> Thank you for report. Can you verify you using psql version 12beta2? You see message like this:
> 
> > ./psql 
> > psql (12beta2)
> > Type "help" for help.
> > 
> > postgres=#
> 
> For example "\d pg_stats" works for me in this case
> 
> Or something like:
> 
> > psql (11.4 (Debian 11.4-1.pgdg100+1), server 12beta2)
> > WARNING: psql major version 11, server major version 12.
> >          Some psql features might not work.
> > Type "help" for help.
> >
> > postgres=#
> 
> Older psql version should give such error, this is expected and we write warning about it.
> 
> regards, Sergei



Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
Daniel Gustafsson
Дата:
> On 28 Jun 2019, at 14:55, c Campo <cc@cj3.cc> wrote:

> I don't know what postgres intends to use older versions of psql to connect to version 12; if postgres intends with
RELEASEversion 12 to only use version 12 of psql to connect to the version 12 postgres, then postgres is ok; if not,
thenthere is a problem. If the intension is the former, then documentation should state so. 

The documentation states this in Notes section for psql:

    "psql works best with servers of the same or an older major version.
    Backslash commands are particularly likely to fail if the server is of
    a newer version than psql itself.  However, backslash commands of the
    \d family should work with servers of versions back to 7.4, though not
    necessarily with servers newer than psql itself."

See https://www.postgresql.org/docs/12/app-psql.html for reference.

cheers ./daniel


Re: BUG #15881: \d name_of_any_table_in_any_database produces ERROR

От
Alvaro Herrera
Дата:
On 2019-Jun-28, c Campo wrote:

> I don't know what postgres intends to use older versions of psql to
> connect to version 12; if postgres intends with RELEASE version 12 to
> only use version 12 of psql to connect to the version 12 postgres,

Older versions work, but some specific features don't.  This is
expected, known, and the only way to allow things to move forward.

> then postgres is ok; if not, then there is a problem. If the intension
> is the former, then documentation should state so. 

It seems okay.  This is what psql says that when you connect:

> WARNING: psql major version 9.6, server major version 12.
>          Some psql features might not work.

It seems very clear to me, but maybe I'm just too used to it.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services