user table in Mailman3 with PostgreSQL

Hello,
I am not sure it is a good idea to name the user table "user". As you can see in PostgreSQL "user" is a reserved word:
\c mailman
select * from user; current_user
postgres
(1 row)
Any ideas how I can still list the content of the mailman3 user table in PostgreSQL?
Regards ML

On 07/15/2014 06:16 AM, ML mail wrote:
You should wrap the name of the table in double quotation marks:
dkg=> create table "user" ( foo int ); CREATE TABLE dkg=> insert into "user" (foo) VALUES (1); INSERT 0 1 dkg=> select * from "user"; foo
1 (1 row)
dkg=>
This is generally good practice for all table names, if you want to treat them consistently in your code.
hth,
--dkg

Thanks for the trick with the double quotes to escape reserved keywords.
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
On Tuesday, July 15, 2014 3:25 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote: On 07/15/2014 06:16 AM, ML mail wrote:
You should wrap the name of the table in double quotation marks:
dkg=> create table "user" ( foo int ); CREATE TABLE dkg=> insert into "user" (foo) VALUES (1); INSERT 0 1 dkg=> select * from "user"; foo
1 (1 row)
dkg=>
This is generally good practice for all table names, if you want to treat them consistently in your code.
hth,
--dkg

On 07/16/2014 10:34 AM, ML mail wrote:
Thanks for the trick with the double quotes to escape reserved keywords.
It's probably worth reading the PostgreSQL documentation for this sort of thing:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX...
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
You already know how to find the content of the table:
select * from "tablename"
If you're asking about inspecting the table structure from the psql command line, you probably want \d "tablename" or one of its variants. If you're not familiar with the psql command line, you probably want to know about the two main help commands: \? and \h.
For further questions about postgresql, you should ask on a psql-specific mailing list. The current list is for discussing mailman, so we are increasingly off-topic.
You can find a good set of postgresql mailing lists here:
http://www.postgresql.org/list/
Regards,
--dkg

Thanks for the details but actually I was now only asking in which table are stored the e-mail addresses of a mailing's list subscribers? I thought they would be stored in the "user" table but I can't see any e-mail addresses there, neither in the member table.
On Wednesday, July 16, 2014 4:58 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote: On 07/16/2014 10:34 AM, ML mail wrote:
Thanks for the trick with the double quotes to escape reserved keywords.
It's probably worth reading the PostgreSQL documentation for this sort of thing:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX...
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
You already know how to find the content of the table:
select * from "tablename"
If you're asking about inspecting the table structure from the psql command line, you probably want \d "tablename" or one of its variants. If you're not familiar with the psql command line, you probably want to know about the two main help commands: \? and \h.
For further questions about postgresql, you should ask on a psql-specific mailing list. The current list is for discussing mailman, so we are increasingly off-topic.
You can find a good set of postgresql mailing lists here:
http://www.postgresql.org/list/
Regards,
--dkg

On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.

Thanks, it all makes sense now!
On Wednesday, July 16, 2014 7:20 PM, Barry Warsaw <barry@list.org> wrote: On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.

Thanks, it all makes sense now!
On Wednesday, July 16, 2014 7:20 PM, Barry Warsaw <barry@list.org> wrote: On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.

On 07/15/2014 06:16 AM, ML mail wrote:
You should wrap the name of the table in double quotation marks:
dkg=> create table "user" ( foo int ); CREATE TABLE dkg=> insert into "user" (foo) VALUES (1); INSERT 0 1 dkg=> select * from "user"; foo
1 (1 row)
dkg=>
This is generally good practice for all table names, if you want to treat them consistently in your code.
hth,
--dkg

Thanks for the trick with the double quotes to escape reserved keywords.
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
On Tuesday, July 15, 2014 3:25 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote: On 07/15/2014 06:16 AM, ML mail wrote:
You should wrap the name of the table in double quotation marks:
dkg=> create table "user" ( foo int ); CREATE TABLE dkg=> insert into "user" (foo) VALUES (1); INSERT 0 1 dkg=> select * from "user"; foo
1 (1 row)
dkg=>
This is generally good practice for all table names, if you want to treat them consistently in your code.
hth,
--dkg

On 07/16/2014 10:34 AM, ML mail wrote:
Thanks for the trick with the double quotes to escape reserved keywords.
It's probably worth reading the PostgreSQL documentation for this sort of thing:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX...
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
You already know how to find the content of the table:
select * from "tablename"
If you're asking about inspecting the table structure from the psql command line, you probably want \d "tablename" or one of its variants. If you're not familiar with the psql command line, you probably want to know about the two main help commands: \? and \h.
For further questions about postgresql, you should ask on a psql-specific mailing list. The current list is for discussing mailman, so we are increasingly off-topic.
You can find a good set of postgresql mailing lists here:
http://www.postgresql.org/list/
Regards,
--dkg

Thanks for the details but actually I was now only asking in which table are stored the e-mail addresses of a mailing's list subscribers? I thought they would be stored in the "user" table but I can't see any e-mail addresses there, neither in the member table.
On Wednesday, July 16, 2014 4:58 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote: On 07/16/2014 10:34 AM, ML mail wrote:
Thanks for the trick with the double quotes to escape reserved keywords.
It's probably worth reading the PostgreSQL documentation for this sort of thing:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX...
Actually I wanted to display the content of the user table to find out in which table are the subscribers of any mailing list recorded. Do you have any idea?
You already know how to find the content of the table:
select * from "tablename"
If you're asking about inspecting the table structure from the psql command line, you probably want \d "tablename" or one of its variants. If you're not familiar with the psql command line, you probably want to know about the two main help commands: \? and \h.
For further questions about postgresql, you should ask on a psql-specific mailing list. The current list is for discussing mailman, so we are increasingly off-topic.
You can find a good set of postgresql mailing lists here:
http://www.postgresql.org/list/
Regards,
--dkg

On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.

Thanks, it all makes sense now!
On Wednesday, July 16, 2014 7:20 PM, Barry Warsaw <barry@list.org> wrote: On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.

Thanks, it all makes sense now!
On Wednesday, July 16, 2014 7:20 PM, Barry Warsaw <barry@list.org> wrote: On Jul 16, 2014, at 08:20 AM, 'ML mail' via barry wrote:
Correct. It's useful to understand the model.
http://pythonhosted.org//mailman/src/mailman/docs/8-miles-high.html#user-mod...
Users have an id and a display name. Addresses are separate objects linked to at most one user. A user can be linked to many addresses. Members associate an address/user with a mailing list[*] under a specific role. Rosters are "magical" objects which perform queries to answer questions like "all the regular delivery members of a mailing list" or "all of the list's moderators".
So the information you're looking for isn't captured in a single table. You'll have to do a query to get the email addresses of a mailing list's subscribers. Take a look at the roster implementations for details.
Cheers, -Barry
[*] A member links a user only if that user has a preferred address.
participants (3)
-
Barry Warsaw
-
Daniel Kahn Gillmor
-
ML mail