Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-07 Thread Michael Paquier
On Wed, Jun 8, 2016 at 7:06 AM, Alvaro Herrera  wrote:
> Michael Paquier wrote:
>> On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
>>  wrote:
>> > On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
>> >  wrote:
>> >> I have added an open item for 9.6 regarding this patch, that would be
>> >> good to complete this work in this release for consistency with the
>> >> other objects.
>> >
>> > Doh. I forgot to update psql --help.
>>
>> And Query_for_list_of_access_methods was defined more or less twice,
>> the one of my patch having an error...
>
> Thanks, I have pushed this.  I only added a "translate_columns" option
> to printQuery.

Thanks.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-07 Thread Alvaro Herrera
Michael Paquier wrote:
> On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
>  wrote:
> > On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
> >  wrote:
> >> I have added an open item for 9.6 regarding this patch, that would be
> >> good to complete this work in this release for consistency with the
> >> other objects.
> >
> > Doh. I forgot to update psql --help.
> 
> And Query_for_list_of_access_methods was defined more or less twice,
> the one of my patch having an error...

Thanks, I have pushed this.  I only added a "translate_columns" option
to printQuery.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-06 Thread Michael Paquier
On Tue, Jun 7, 2016 at 7:35 AM, Alvaro Herrera  wrote:
> In looking at the DROP ACCESS METHOD completion I noticed that the
> words_after_create gadget is a bit buggy: for things with more than one
> word in the thing name (such as MATERIALIZED VIEW, USER MAPPING FOR,
> EVENT TRIGGER among others) the "query/squery"-based completion isn't
> triggered, because the loop at the end of psql_completion only considers
> a single word (using strcmp against prev_wd), which obviously doesn't
> match the multiple-word specifier in the struct.  Some things such as
> EVENT TRIGGER and MATERIALIZED VIEW have specialized code that does the
> actual work; the latter specifies a query in words_after_create, but
> it's dead code.  As a probably separate but related bug, CREATE USER
> MAPPING FOR stops working after you tab-complete the USER in it.

Yes, that's not new...

> Lastly, there is an entry for CONFIGURATION which also doesn't work:
> if you enter "DROP " it doesn't complete CONFIGURATION, but if you
> enter "DROP CONFIGURATION " then it shows a list of text search
> configurations, which is not a valid command.

This is not a new issue as well. Even before the tab completion
refactoring things are behaving this way. There is much room for
improvements. The refactoring makes back-patching a bit more
difficult, so we may just want to get those improvements in 9.6~ based
on the lack of complaints regarding that.

> To conclude, so far as I can tell, your patch (for DROP AM completion)
> is fine, but the existing code has some minor flags which we could just
> as well ignore for now, but could be improved in the future.

Thanks!
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-06 Thread Alvaro Herrera
Michael Paquier wrote:
> On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
>  wrote:
> > On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
> >  wrote:
> >> I have added an open item for 9.6 regarding this patch, that would be
> >> good to complete this work in this release for consistency with the
> >> other objects.
> >
> > Doh. I forgot to update psql --help.
> 
> And Query_for_list_of_access_methods was defined more or less twice,
> the one of my patch having an error...

In looking at the DROP ACCESS METHOD completion I noticed that the
words_after_create gadget is a bit buggy: for things with more than one
word in the thing name (such as MATERIALIZED VIEW, USER MAPPING FOR,
EVENT TRIGGER among others) the "query/squery"-based completion isn't
triggered, because the loop at the end of psql_completion only considers
a single word (using strcmp against prev_wd), which obviously doesn't
match the multiple-word specifier in the struct.  Some things such as
EVENT TRIGGER and MATERIALIZED VIEW have specialized code that does the
actual work; the latter specifies a query in words_after_create, but
it's dead code.  As a probably separate but related bug, CREATE USER
MAPPING FOR stops working after you tab-complete the USER in it.
Lastly, there is an entry for CONFIGURATION which also doesn't work: if
you enter "DROP " it doesn't complete CONFIGURATION, but if you
enter "DROP CONFIGURATION " then it shows a list of text search
configurations, which is not a valid command.

To conclude, so far as I can tell, your patch (for DROP AM completion)
is fine, but the existing code has some minor flags which we could just
as well ignore for now, but could be improved in the future.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-06 Thread Alvaro Herrera
Noah Misch wrote:

> The above-described topic is currently a PostgreSQL 9.6 open item.  Álvaro,
> since you committed the patch believed to have created it, you own this open
> item.  If some other commit is more relevant or if this does not belong as a
> 9.6 open item, please let us know.  Otherwise, please observe the policy on
> open item ownership[1] and send a status update within 72 hours of this
> message.  Include a date for your subsequent status update.  Testers may
> discover new open items at any time, and I want to plan to get them all fixed
> well in advance of shipping 9.6rc1.  Consequently, I will appreciate your
> efforts toward speedy resolution.  Thanks.

I'll have this patch reviewed, and barring serious problems, committed
no later than EOB Friday 10th.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-04 Thread Noah Misch
On Thu, Jun 02, 2016 at 04:00:33PM +0900, Michael Paquier wrote:
> On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
>  wrote:
> > On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
> >  wrote:
> >> I have added an open item for 9.6 regarding this patch, that would be
> >> good to complete this work in this release for consistency with the
> >> other objects.
> >
> > Doh. I forgot to update psql --help.
> 
> And Query_for_list_of_access_methods was defined more or less twice,
> the one of my patch having an error...

[Action required within 72 hours.  This is a generic notification.]

The above-described topic is currently a PostgreSQL 9.6 open item.  Álvaro,
since you committed the patch believed to have created it, you own this open
item.  If some other commit is more relevant or if this does not belong as a
9.6 open item, please let us know.  Otherwise, please observe the policy on
open item ownership[1] and send a status update within 72 hours of this
message.  Include a date for your subsequent status update.  Testers may
discover new open items at any time, and I want to plan to get them all fixed
well in advance of shipping 9.6rc1.  Consequently, I will appreciate your
efforts toward speedy resolution.  Thanks.

[1] 
http://www.postgresql.org/message-id/20160527025039.ga447...@tornado.leadboat.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-02 Thread Michael Paquier
On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
 wrote:
> On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
>  wrote:
>> I have added an open item for 9.6 regarding this patch, that would be
>> good to complete this work in this release for consistency with the
>> other objects.
>
> Doh. I forgot to update psql --help.

And Query_for_list_of_access_methods was defined more or less twice,
the one of my patch having an error...
-- 
Michael
From 220cb52ecde2943ce909a3a418c3b6e1e5171863 Mon Sep 17 00:00:00 2001
From: Michael Paquier 
Date: Thu, 2 Jun 2016 15:59:31 +0900
Subject: [PATCH] Add support for COMMENT ON and psql meta-command for access 
 methods

473b932 has visibly forgotten that access methods, being database objects
could have a description associated with them. Having a psql-level meta
command that allows to list all the access commands available on the
server was missing as well.

At the same time, I have noticed that tab completion of psql could be
more verbose regarding access methods, those things are fixed at the
same time.
---
 contrib/bloom/bloom--1.0.sql   |  1 +
 doc/src/sgml/ref/comment.sgml  |  1 +
 doc/src/sgml/ref/psql-ref.sgml | 13 +
 src/backend/parser/gram.y  |  5 ++--
 src/bin/psql/command.c |  3 +++
 src/bin/psql/describe.c| 61 ++
 src/bin/psql/describe.h|  3 +++
 src/bin/psql/help.c|  1 +
 src/bin/psql/tab-complete.c| 25 -
 9 files changed, 104 insertions(+), 9 deletions(-)

diff --git a/contrib/bloom/bloom--1.0.sql b/contrib/bloom/bloom--1.0.sql
index 7fa7513..87b5442 100644
--- a/contrib/bloom/bloom--1.0.sql
+++ b/contrib/bloom/bloom--1.0.sql
@@ -5,6 +5,7 @@ LANGUAGE C;
 
 -- Access method
 CREATE ACCESS METHOD bloom TYPE INDEX HANDLER blhandler;
+COMMENT ON ACCESS METHOD bloom IS 'bloom index access method';
 
 -- Opclasses
 
diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml
index 3321d4b..9582de8 100644
--- a/doc/src/sgml/ref/comment.sgml
+++ b/doc/src/sgml/ref/comment.sgml
@@ -23,6 +23,7 @@ PostgreSQL documentation
 
 COMMENT ON
 {
+  ACCESS METHOD object_name |
   AGGREGATE aggregate_name ( aggregate_signature ) |
   CAST (source_type AS target_type) |
   COLLATION object_name |
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index df79a37..4079ac6 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1130,6 +1130,19 @@ testdb=
 
   
 
+  
+\dA[+] [ pattern ]
+
+
+
+Lists access methods. If pattern is specified, only access
+methods whose names match the pattern are shown. If
++ is appended to the command name, each access
+method is listed with its associated handler function and description.
+
+
+  
 
   
 \db[+] [ pattern ]
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 20384db..5d646e7 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -5693,8 +5693,8 @@ opt_restart_seqs:
  *	The COMMENT ON statement can take different forms based upon the type of
  *	the object associated with the comment. The form of the statement is:
  *
- *	COMMENT ON [ [ CONVERSION | COLLATION | DATABASE | DOMAIN |
- * EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
+ *	COMMENT ON [ [ ACCESS METHOD | CONVERSION | COLLATION | DATABASE |
+ * DOMAIN | EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
  * FOREIGN TABLE | INDEX | [PROCEDURAL] LANGUAGE |
  * MATERIALIZED VIEW | POLICY | ROLE | SCHEMA | SEQUENCE |
  * SERVER | TABLE | TABLESPACE |
@@ -5896,6 +5896,7 @@ comment_type:
 			| TABLE{ $$ = OBJECT_TABLE; }
 			| VIEW{ $$ = OBJECT_VIEW; }
 			| MATERIALIZED VIEW	{ $$ = OBJECT_MATVIEW; }
+			| ACCESS METHOD		{ $$ = OBJECT_ACCESS_METHOD; }
 			| COLLATION			{ $$ = OBJECT_COLLATION; }
 			| CONVERSION_P		{ $$ = OBJECT_CONVERSION; }
 			| TABLESPACE		{ $$ = OBJECT_TABLESPACE; }
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 693b531..543fe5f 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -402,6 +402,9 @@ exec_command(const char *cmd,
 	/* standard listing of interesting things */
 	success = listTables("tvmsE", NULL, show_verbose, show_system);
 break;
+			case 'A':
+success = describeAccessMethods(pattern, show_verbose);
+break;
 			case 'a':
 success = describeAggregates(pattern, show_verbose, show_system);
 break;
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 0a771bd..4e9e6ac 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -129,6 +129,67 @@ describeAggregates(const char *pattern, bool verbose, bool showSystem)
 	return true;
 }
 
+/* \dA
+ * Takes an 

Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-02 Thread Michael Paquier
On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
 wrote:
> I have added an open item for 9.6 regarding this patch, that would be
> good to complete this work in this release for consistency with the
> other objects.

Doh. I forgot to update psql --help.
-- 
Michael
From 9901595fd000c3ac9e1c1ce8ee2f21218c4803c7 Mon Sep 17 00:00:00 2001
From: Michael Paquier 
Date: Thu, 2 Jun 2016 12:47:46 +0900
Subject: [PATCH] Add support for COMMENT ON and psql meta-command for access
 methods

473b932 has visibly forgotten that access methods, being database objects
could have a description associated with them. Having a psql-level meta
command that allows to list all the access commands available on the
server was missing as well.

At the same time, I have noticed that tab completion of psql could be
more verbose regarding access methods, those things are fixed at the
same time.
---
 contrib/bloom/bloom--1.0.sql   |  1 +
 doc/src/sgml/ref/comment.sgml  |  1 +
 doc/src/sgml/ref/psql-ref.sgml | 13 +
 src/backend/parser/gram.y  |  5 ++--
 src/bin/psql/command.c |  3 +++
 src/bin/psql/describe.c| 61 ++
 src/bin/psql/describe.h|  3 +++
 src/bin/psql/help.c|  1 +
 src/bin/psql/tab-complete.c| 30 -
 9 files changed, 109 insertions(+), 9 deletions(-)

diff --git a/contrib/bloom/bloom--1.0.sql b/contrib/bloom/bloom--1.0.sql
index 7fa7513..87b5442 100644
--- a/contrib/bloom/bloom--1.0.sql
+++ b/contrib/bloom/bloom--1.0.sql
@@ -5,6 +5,7 @@ LANGUAGE C;
 
 -- Access method
 CREATE ACCESS METHOD bloom TYPE INDEX HANDLER blhandler;
+COMMENT ON ACCESS METHOD bloom IS 'bloom index access method';
 
 -- Opclasses
 
diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml
index 3321d4b..9582de8 100644
--- a/doc/src/sgml/ref/comment.sgml
+++ b/doc/src/sgml/ref/comment.sgml
@@ -23,6 +23,7 @@ PostgreSQL documentation
 
 COMMENT ON
 {
+  ACCESS METHOD object_name |
   AGGREGATE aggregate_name ( aggregate_signature ) |
   CAST (source_type AS target_type) |
   COLLATION object_name |
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index df79a37..4079ac6 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1130,6 +1130,19 @@ testdb=
 
   
 
+  
+\dA[+] [ pattern ]
+
+
+
+Lists access methods. If pattern is specified, only access
+methods whose names match the pattern are shown. If
++ is appended to the command name, each access
+method is listed with its associated handler function and description.
+
+
+  
 
   
 \db[+] [ pattern ]
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 20384db..5d646e7 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -5693,8 +5693,8 @@ opt_restart_seqs:
  *	The COMMENT ON statement can take different forms based upon the type of
  *	the object associated with the comment. The form of the statement is:
  *
- *	COMMENT ON [ [ CONVERSION | COLLATION | DATABASE | DOMAIN |
- * EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
+ *	COMMENT ON [ [ ACCESS METHOD | CONVERSION | COLLATION | DATABASE |
+ * DOMAIN | EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
  * FOREIGN TABLE | INDEX | [PROCEDURAL] LANGUAGE |
  * MATERIALIZED VIEW | POLICY | ROLE | SCHEMA | SEQUENCE |
  * SERVER | TABLE | TABLESPACE |
@@ -5896,6 +5896,7 @@ comment_type:
 			| TABLE{ $$ = OBJECT_TABLE; }
 			| VIEW{ $$ = OBJECT_VIEW; }
 			| MATERIALIZED VIEW	{ $$ = OBJECT_MATVIEW; }
+			| ACCESS METHOD		{ $$ = OBJECT_ACCESS_METHOD; }
 			| COLLATION			{ $$ = OBJECT_COLLATION; }
 			| CONVERSION_P		{ $$ = OBJECT_CONVERSION; }
 			| TABLESPACE		{ $$ = OBJECT_TABLESPACE; }
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 693b531..543fe5f 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -402,6 +402,9 @@ exec_command(const char *cmd,
 	/* standard listing of interesting things */
 	success = listTables("tvmsE", NULL, show_verbose, show_system);
 break;
+			case 'A':
+success = describeAccessMethods(pattern, show_verbose);
+break;
 			case 'a':
 success = describeAggregates(pattern, show_verbose, show_system);
 break;
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 0a771bd..4e9e6ac 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -129,6 +129,67 @@ describeAggregates(const char *pattern, bool verbose, bool showSystem)
 	return true;
 }
 
+/* \dA
+ * Takes an optional regexp to select particular access methods
+ */
+bool
+describeAccessMethods(const char *pattern, bool verbose)
+{
+	PQExpBufferData buf;
+	PGresult   *res;
+	printQueryOpt myopt = pset.popt;
+
+	

Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-01 Thread Michael Paquier
On Wed, Jun 1, 2016 at 8:25 PM, Teodor Sigaev  wrote:
 As far as I can see, COMMENT ON has no support for access methods.
 Wouldn't we want to add it as it is created by a command? On top of
 that, perhaps we could have a backslash command in psql to list the
 supported access methods, like \dam[S]? The system methods would be in
 this case all the in-core ones.
>>>
>>>
>>> +1.
>>
>>
>> Are there other opinions? That's not a 9.6 blocker IMO, so I could get
>> patches out for 10.0 if needed.
>
>
> I missed that on review process, but I'm agree it should be implemented.

So, I have taken the time to hack that, and finished with the patch
attached, that is less intrusive than I thought first:
- COMMENT support is added for access methods
- Added meta-command \dA in psql to list the available access methods:
=# \dA
List of access methods
  Name  | Type
+---
 bloom  | Index
 brin   | Index
 btree  | Index
 gin| Index
 gist   | Index
 hash   | Index
 spgist | Index
(7 rows)
=# \dA+
List of access methods
  Name  | Type  |   Handler   |  Description
+---+-+
 bloom  | Index | blhandler   | bloom index access method
 brin   | Index | brinhandler | block range index (BRIN) access method
 btree  | Index | bthandler   | b-tree index access method
 gin| Index | ginhandler  | GIN index access method
 gist   | Index | gisthandler | GiST index access method
 hash   | Index | hashhandler | hash index access method
 spgist | Index | spghandler  | SP-GiST index access method
(7 rows)
- Fixed a missing tab completion for DROP ACCESS METHOD.

I have added an open item for 9.6 regarding this patch, that would be
good to complete this work in this release for consistency with the
other objects.
Regards,
-- 
Michael
From 12c5d77c7d66cd8b33c697fc389cf9915d32765b Mon Sep 17 00:00:00 2001
From: Michael Paquier 
Date: Thu, 2 Jun 2016 12:47:46 +0900
Subject: [PATCH] Add support for COMMENT ON and psql meta-command for access
 methods

473b932 has visibly forgotten that access methods, being database objects
could have a description associated with them. Having a psql-level meta
command that allows to list all the access commands available on the
server was missing as well.

At the same time, I have noticed that tab completion of psql could be
more verbose regarding access methods, those things are fixed at the
same time.
---
 contrib/bloom/bloom--1.0.sql   |  1 +
 doc/src/sgml/ref/comment.sgml  |  1 +
 doc/src/sgml/ref/psql-ref.sgml | 13 +
 src/backend/parser/gram.y  |  5 ++--
 src/bin/psql/command.c |  3 +++
 src/bin/psql/describe.c| 61 ++
 src/bin/psql/describe.h|  3 +++
 src/bin/psql/tab-complete.c| 30 -
 8 files changed, 108 insertions(+), 9 deletions(-)

diff --git a/contrib/bloom/bloom--1.0.sql b/contrib/bloom/bloom--1.0.sql
index 7fa7513..87b5442 100644
--- a/contrib/bloom/bloom--1.0.sql
+++ b/contrib/bloom/bloom--1.0.sql
@@ -5,6 +5,7 @@ LANGUAGE C;
 
 -- Access method
 CREATE ACCESS METHOD bloom TYPE INDEX HANDLER blhandler;
+COMMENT ON ACCESS METHOD bloom IS 'bloom index access method';
 
 -- Opclasses
 
diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml
index 3321d4b..9582de8 100644
--- a/doc/src/sgml/ref/comment.sgml
+++ b/doc/src/sgml/ref/comment.sgml
@@ -23,6 +23,7 @@ PostgreSQL documentation
 
 COMMENT ON
 {
+  ACCESS METHOD object_name |
   AGGREGATE aggregate_name ( aggregate_signature ) |
   CAST (source_type AS target_type) |
   COLLATION object_name |
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index df79a37..4079ac6 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1130,6 +1130,19 @@ testdb=
 
   
 
+  
+\dA[+] [ pattern ]
+
+
+
+Lists access methods. If pattern is specified, only access
+methods whose names match the pattern are shown. If
++ is appended to the command name, each access
+method is listed with its associated handler function and description.
+
+
+  
 
   
 \db[+] [ pattern ]
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 20384db..5d646e7 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -5693,8 +5693,8 @@ opt_restart_seqs:
  *	The COMMENT ON statement can take different forms based upon the type of
  *	the object associated with the comment. The form of the statement is:
  *
- *	COMMENT ON [ [ CONVERSION | COLLATION | DATABASE | DOMAIN |
- * EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
+ *	COMMENT ON [ [ ACCESS METHOD | CONVERSION | COLLATION | DATABASE |
+ * DOMAIN | EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER |
  * FOREIGN 

Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-01 Thread Teodor Sigaev

As far as I can see, COMMENT ON has no support for access methods.
Wouldn't we want to add it as it is created by a command? On top of
that, perhaps we could have a backslash command in psql to list the
supported access methods, like \dam[S]? The system methods would be in
this case all the in-core ones.


+1.


Are there other opinions? That's not a 9.6 blocker IMO, so I could get
patches out for 10.0 if needed.


I missed that on review process, but I'm agree it should be implemented.

--
Teodor Sigaev   E-mail: teo...@sigaev.ru
   WWW: http://www.sigaev.ru/


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-05-31 Thread Michael Paquier
On Wed, Jun 1, 2016 at 4:52 AM, Robert Haas  wrote:
> On Fri, May 27, 2016 at 7:53 AM, Michael Paquier
>  wrote:
>> As far as I can see, COMMENT ON has no support for access methods.
>> Wouldn't we want to add it as it is created by a command? On top of
>> that, perhaps we could have a backslash command in psql to list the
>> supported access methods, like \dam[S]? The system methods would be in
>> this case all the in-core ones.
>
> +1.

Are there other opinions? That's not a 9.6 blocker IMO, so I could get
patches out for 10.0 if needed.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-05-31 Thread Robert Haas
On Fri, May 27, 2016 at 7:53 AM, Michael Paquier
 wrote:
> As far as I can see, COMMENT ON has no support for access methods.
> Wouldn't we want to add it as it is created by a command? On top of
> that, perhaps we could have a backslash command in psql to list the
> supported access methods, like \dam[S]? The system methods would be in
> this case all the in-core ones.

+1.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] COMMENT ON, psql and access methods

2016-05-27 Thread Tom Lane
Michael Paquier  writes:
> As far as I can see, COMMENT ON has no support for access methods.
> Wouldn't we want to add it as it is created by a command? On top of
> that, perhaps we could have a backslash command in psql to list the
> supported access methods, like \dam[S]? The system methods would be in
> this case all the in-core ones.

I'm a bit skeptical that we need this yet.  Maybe if custom access methods
become so popular that everybody's got one, it'd be worth the trouble.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] COMMENT ON, psql and access methods

2016-05-27 Thread Michael Paquier
Hi all,

As far as I can see, COMMENT ON has no support for access methods.
Wouldn't we want to add it as it is created by a command? On top of
that, perhaps we could have a backslash command in psql to list the
supported access methods, like \dam[S]? The system methods would be in
this case all the in-core ones.

Regards,
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers