public inbox for [email protected]  
help / color / mirror / Atom feed
Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset
10+ messages / 3 participants
[nested] [flat]

* Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset
@ 2022-02-21 05:50 Masahiko Sawada <[email protected]>
  2022-02-21 10:49 ` Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset Amit Kapila <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Masahiko Sawada @ 2022-02-21 05:50 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Postgres hackers <[email protected]>; Amit Kapila <[email protected]>

Hi,

On Mon, Feb 21, 2022 at 2:36 PM Michael Paquier <[email protected]> wrote:
>
> Hi all,
> (Author and committer added in CC.)
>
> While reviewing the code of a bunch of SRF functions in the core code,
> I have noticed that the two functions mentioned in $subject are marked
> as proretset but both functions don't return a set of tuples, just one
> record for the object given in input.  It is also worth noting that
> prorows is set to 1.

Thanks for pointing it out. Agreed.

>
> This looks like a copy-pasto error that has spread around.  The error
> on pg_stat_get_subscription_worker is recent as of 8d74fc9, and the
> one on pg_stat_get_replication_slot has been introduced in 3fa17d3,
> meaning that REL_14_STABLE got it wrong for the second part.
>
> I am aware about the discussions on the parent view for the first
> case and its design issues, but it does not change the fact that we'd
> better address the second case on HEAD IMO.
>
> Thoughts?

Agreed.

Regards,


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






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset
  2022-02-21 05:50 Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset Masahiko Sawada <[email protected]>
@ 2022-02-21 10:49 ` Amit Kapila <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Amit Kapila @ 2022-02-21 10:49 UTC (permalink / raw)
  To: Masahiko Sawada <[email protected]>; +Cc: Michael Paquier <[email protected]>; Postgres hackers <[email protected]>

On Mon, Feb 21, 2022 at 11:21 AM Masahiko Sawada <[email protected]> wrote:
>
> >
> > I am aware about the discussions on the parent view for the first
> > case and its design issues, but it does not change the fact that we'd
> > better address the second case on HEAD IMO.
> >
> > Thoughts?
>
> Agreed.
>

+1. How about attached?

-- 
With Regards,
Amit Kapila.


Attachments:

  [application/octet-stream] fix_pgproc_get_repl_slot_1.patch (1.2K, ../../CAA4eK1LezjxzV3yU6ZNTy5GoQR0QbYWen1bQa8uT37OEyM0Jnw@mail.gmail.com/2-fix_pgproc_get_repl_slot_1.patch)
  download | inline diff:
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 7f1ee97..7de8cfc 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -5370,9 +5370,8 @@
   proargnames => '{pid,status,receive_start_lsn,receive_start_tli,written_lsn,flushed_lsn,received_tli,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time,slot_name,sender_host,sender_port,conninfo}',
   prosrc => 'pg_stat_get_wal_receiver' },
 { oid => '6169', descr => 'statistics: information about replication slot',
-  proname => 'pg_stat_get_replication_slot', prorows => '1', proisstrict => 'f',
-  proretset => 't', provolatile => 's', proparallel => 'r',
-  prorettype => 'record', proargtypes => 'text',
+  proname => 'pg_stat_get_replication_slot', proisstrict => 'f', provolatile => 's',
+  proparallel => 'r', prorettype => 'record', proargtypes => 'text',
   proallargtypes => '{text,text,int8,int8,int8,int8,int8,int8,int8,int8,timestamptz}',
   proargmodes => '{i,o,o,o,o,o,o,o,o,o,o}',
   proargnames => '{slot_name,slot_name,spill_txns,spill_count,spill_bytes,stream_txns,stream_count,stream_bytes,total_txns,total_bytes,stats_reset}',


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* [PATCH v1] psql: Fix \df tab completion for procedures
@ 2025-11-22 14:42 Erik Wienhold <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Erik Wienhold @ 2025-11-22 14:42 UTC (permalink / raw)

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0


--5rsvev5qaoortkiw--





^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2025-11-22 14:42 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 05:50 Re: pg_stat_get_replication_slot and pg_stat_get_subscription_worker incorrectly marked as proretset Masahiko Sawada <[email protected]>
2022-02-21 10:49 ` Amit Kapila <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>
2025-11-22 14:42 [PATCH v1] psql: Fix \df tab completion for procedures Erik Wienhold <[email protected]>

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