[Django] #32292: Allow postgresql database connections to use postgres services

35 views
Skip to first unread message

Django

unread,
Dec 21, 2020, 2:43:32 PM12/21/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: 3.1
layer (models, ORM) | Keywords: database postgresql
Severity: Normal | postgres service pg_service config
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Postgres offers a way to make database connections through the use of
services, which are basically equivalent to MySQL's options files.

Server, database, username, etc information is stored by default in
`~/.pg_service.confg` and takes a very similar format to MySQL cnf files:

```
[my_alias]
host=10.0.19.10
user=postgres
dbname=postgres
port=5432
```

And password can be stored in `~/.pgpass` under a different format.

I think being able to just add them to the DATABASES config would be
useful, similar to how you can add MySQL cnf files. psycopg2 supports it
just fine through the service argument/string `connect(service='my_alias')
connect('service=my_alias')`.

At the moment it can be added like this:

```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'OPTIONS': {'service': 'my_alias'}
}
}
```

Which works, however it involves repeating the database name. I don't
think the database name should be repeated twice because it couples the
config and the service file together, and makes it harder to just move it
between different environments. I think ideally you would just specify the
service, either like this:

```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {'service': 'my_alias'}
}
}
```

Or maybe a better way would be?:

```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'SERVICE': 'my_alias
}
}
```

It seems like something that would be super easy to add. I don't mind
creating a pull request for it, but would like to know why it hasn't been
added, and how it would be recommended to add it.

--
Ticket URL: <https://code.djangoproject.com/ticket/32292>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 21, 2020, 2:45:01 PM12/21/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
postgres service pg_service | Unreviewed
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by levihb:

Old description:

New description:

Postgres offers a way to make database connections through the use of
services, which are basically equivalent to MySQL's options files.

Server, database, username, etc information is stored by default in
`~/.pg_service.confg` and takes a very similar format to MySQL cnf files:

```
[my_alias]
host=10.0.19.10
user=postgres
dbname=postgres
port=5432
```

And password can be stored in `~/.pgpass` under a different format.

I think being able to just add them to the DATABASES config would be
useful, similar to how you can add MySQL cnf files. psycopg2 supports it
just fine through the service argument/string `connect(service='my_alias')
connect('service=my_alias')`.

At the moment it can be added like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Which works, however it involves repeating the database name. I don't
think the database name should be repeated twice because it couples the
config and the service file together, and makes it harder to just move it
between different environments. I think ideally you would just specify the
service, either like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Or maybe a better way would be?:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'SERVICE': 'my_alias
}
}
}}}

It seems like something that would be super easy to add. I don't mind
creating a pull request for it, but would like to know why it hasn't been
added, and how it would be recommended to add it.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:1>

Django

unread,
Dec 21, 2020, 2:45:22 PM12/21/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
postgres service pg_service | Unreviewed
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by levihb:

Old description:

> Postgres offers a way to make database connections through the use of


> services, which are basically equivalent to MySQL's options files.
>
> Server, database, username, etc information is stored by default in
> `~/.pg_service.confg` and takes a very similar format to MySQL cnf files:
>
> ```
> [my_alias]
> host=10.0.19.10
> user=postgres
> dbname=postgres
> port=5432
> ```
>
> And password can be stored in `~/.pgpass` under a different format.
>
> I think being able to just add them to the DATABASES config would be
> useful, similar to how you can add MySQL cnf files. psycopg2 supports it
> just fine through the service argument/string
> `connect(service='my_alias') connect('service=my_alias')`.
>
> At the moment it can be added like this:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': 'postgres',
> 'OPTIONS': {'service': 'my_alias'}
> }
> }
> }}}
>
> Which works, however it involves repeating the database name. I don't
> think the database name should be repeated twice because it couples the
> config and the service file together, and makes it harder to just move it
> between different environments. I think ideally you would just specify
> the service, either like this:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'OPTIONS': {'service': 'my_alias'}
> }
> }
> }}}
>
> Or maybe a better way would be?:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'SERVICE': 'my_alias
> }
> }
> }}}
>
> It seems like something that would be super easy to add. I don't mind
> creating a pull request for it, but would like to know why it hasn't
> been added, and how it would be recommended to add it.

New description:

Postgres offers a way to make database connections through the use of
services, which are basically equivalent to MySQL's options files.

Server, database, username, etc information is stored by default in
`~/.pg_service.confg` and takes a very similar format to MySQL cnf files:

{{{#!python


[my_alias]
host=10.0.19.10
user=postgres
dbname=postgres
port=5432
}}}

And password can be stored in `~/.pgpass` under a different format.

I think being able to just add them to the DATABASES config would be
useful, similar to how you can add MySQL cnf files. psycopg2 supports it
just fine through the service argument/string `connect(service='my_alias')
connect('service=my_alias')`.

At the moment it can be added like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Which works, however it involves repeating the database name. I don't
think the database name should be repeated twice because it couples the
config and the service file together, and makes it harder to just move it
between different environments. I think ideally you would just specify the
service, either like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Or maybe a better way would be?:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'SERVICE': 'my_alias
}
}
}}}

It seems like something that would be super easy to add. I don't mind
creating a pull request for it, but would like to know why it hasn't been
added, and how it would be recommended to add it.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:2>

Django

unread,
Dec 21, 2020, 2:45:36 PM12/21/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
postgres service pg_service | Unreviewed
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by levihb:

Old description:

> Postgres offers a way to make database connections through the use of


> services, which are basically equivalent to MySQL's options files.
>
> Server, database, username, etc information is stored by default in
> `~/.pg_service.confg` and takes a very similar format to MySQL cnf files:
>

> {{{#!python


> [my_alias]
> host=10.0.19.10
> user=postgres
> dbname=postgres
> port=5432
> }}}
>
> And password can be stored in `~/.pgpass` under a different format.
>
> I think being able to just add them to the DATABASES config would be
> useful, similar to how you can add MySQL cnf files. psycopg2 supports it
> just fine through the service argument/string
> `connect(service='my_alias') connect('service=my_alias')`.
>
> At the moment it can be added like this:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': 'postgres',
> 'OPTIONS': {'service': 'my_alias'}
> }
> }
> }}}
>
> Which works, however it involves repeating the database name. I don't
> think the database name should be repeated twice because it couples the
> config and the service file together, and makes it harder to just move it
> between different environments. I think ideally you would just specify
> the service, either like this:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'OPTIONS': {'service': 'my_alias'}
> }
> }
> }}}
>
> Or maybe a better way would be?:
>

> {{{#!python


> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'SERVICE': 'my_alias
> }
> }
> }}}
>
> It seems like something that would be super easy to add. I don't mind
> creating a pull request for it, but would like to know why it hasn't
> been added, and how it would be recommended to add it.

New description:

Postgres offers a way to make database connections through the use of
services, which are basically equivalent to MySQL's options files.

Server, database, username, etc information is stored by default in

`~/.pg_service.conf` and takes a very similar format to MySQL cnf files:

{{{#!python


[my_alias]
host=10.0.19.10
user=postgres
dbname=postgres
port=5432
}}}

And password can be stored in `~/.pgpass` under a different format.

I think being able to just add them to the DATABASES config would be
useful, similar to how you can add MySQL cnf files. psycopg2 supports it
just fine through the service argument/string `connect(service='my_alias')
connect('service=my_alias')`.

At the moment it can be added like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Which works, however it involves repeating the database name. I don't
think the database name should be repeated twice because it couples the
config and the service file together, and makes it harder to just move it
between different environments. I think ideally you would just specify the
service, either like this:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {'service': 'my_alias'}
}
}
}}}

Or maybe a better way would be?:

{{{#!python


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'SERVICE': 'my_alias
}
}
}}}

It seems like something that would be super easy to add. I don't mind
creating a pull request for it, but would like to know why it hasn't been
added, and how it would be recommended to add it.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:3>

Django

unread,
Dec 22, 2020, 12:49:42 AM12/22/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Configuration without `NAME` already works for me, e.g.:
{{{


'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {

'service': 'default_django_test'
}
},
}}}
so only setting `PGSERVICE` for
[https://github.com/django/django/blob/2a76f4313423a3b91caade4fce71790630ef9152/django/db/backends/postgresql/client.py#L10-L44
the underlying command-line client] and docs are missing.

> I don't mind creating a pull request for it, but would like to know why

it hasn't been added, ...

Because you're the first to suggest it.

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:4>

Django

unread,
Dec 22, 2020, 9:13:24 AM12/22/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by levihb):

Replying to [comment:4 Mariusz Felisiak]:


> Configuration without `NAME` already works for me, e.g.:
> {{{

> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'OPTIONS': {

> 'service': 'default_django_test'
> }
> },
> }}}

It doesn't work for me. E.g.:

{{{#!python


'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {

'service': 'test_service'
}
},
}}}

Throws the following when it tries to access the database:

{{{
Traceback (most recent call last):
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/redacted_path/postgres_services/mysite/testapp/views.py", line 9,
in index
c = db_conn.cursor()
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/db/backends/base/base.py", line 259, in cursor
return self._cursor()
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/db/backends/base/base.py", line 235, in _cursor
self.ensure_connection()
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/db/backends/base/base.py", line 199, in connect
conn_params = self.get_connection_params()
File "/redacted_path/postgres_services/venv/lib/python3.8/site-
packages/django/db/backends/postgresql/base.py", line 157, in
get_connection_params
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
improperly configured. Please supply the NAME value.
}}}

While if I just add the NAME value it works just fine. This makes total
sense as if you check the postgres base file it checks:

{{{#!python
if settings_dict['NAME'] == '':
raise ImproperlyConfigured(
"settings.DATABASES is improperly configured. "
"Please supply the NAME value.")
if len(settings_dict['NAME'] or '') > self.ops.max_name_length():
raise ImproperlyConfigured(
"The database name '%s' (%d characters) is longer than "
"PostgreSQL's limit of %d characters. Supply a shorter NAME "
"in settings.DATABASES." % (
settings_dict['NAME'],
len(settings_dict['NAME']),
self.ops.max_name_length(),
)
)
}}}

The first if evaluates to true. `settings_dict['NAME']` must be getting
defaulted to an empty string, because I'm not setting it to empty, I'm
entirely leaving it out.

> so only setting `PGSERVICE` for
[https://github.com/django/django/blob/2a76f4313423a3b91caade4fce71790630ef9152/django/db/backends/postgresql/client.py#L10-L44
the underlying command-line client] and docs are missing.

I don't mind adding support for those either.

> > I don't mind creating a pull request for it, but would like to know

why it hasn't been added, ...


>
> Because you're the first to suggest it.

Oh I was sure I wouldn't have been. I've looked up how to use postgres
services for many projects, and nearly always find people asking, even
when it's for much much smaller projects. That's rather interesting.

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:5>

Django

unread,
Dec 22, 2020, 12:08:52 PM12/22/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

> It doesn't work for me. E.g.:

You're right. I've only checked running tests which works fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:6>

Django

unread,
Dec 23, 2020, 6:16:29 PM12/23/20
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned

Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/13808 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:7>

Django

unread,
Jan 15, 2021, 4:46:38 AM1/15/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:8>

Django

unread,
Jan 17, 2021, 2:53:07 PM1/17/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:9>

Django

unread,
Jan 18, 2021, 12:51:12 AM1/18/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:10>

Django

unread,
Jan 18, 2021, 10:53:26 AM1/18/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:11>

Django

unread,
Jan 20, 2021, 7:00:39 AM1/20/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Ready for
postgres service pg_service | checkin
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:12>

Django

unread,
Jan 20, 2021, 11:59:50 AM1/20/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: closed

Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: database postgresql | Triage Stage: Ready for
postgres service pg_service | checkin
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"dcb3ad3319cad5c270a1856fd5f355e37cf9d474" dcb3ad33]:
{{{
#!CommitTicketReference repository=""
revision="dcb3ad3319cad5c270a1856fd5f355e37cf9d474"
Fixed #32292 -- Added support for connection by service name to
PostgreSQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:13>

Django

unread,
Feb 26, 2021, 2:53:24 AM2/26/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* version: 3.1 => 4.0
* severity: Normal => Release blocker
* stage: Ready for checkin => Accepted


Comment:

I've noticed an issue when checking related ticket #32456. Using `.pgpass`
with [https://github.com/django/django/pull/14043 PR] doesn't work because
`dbshell` is trying to use the default `'postgres'` database when `NAME`
is not set and a service name is in use. It shouldn't pass `dbname` as in
the case of
[https://github.com/django/django/pull/13808#discussion_r559328449
connections].

[https://github.com/django/django/pull/14054 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:14>

Django

unread,
Feb 26, 2021, 2:56:44 AM2/26/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: new

Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: closed => new
* resolution: fixed =>


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:15>

Django

unread,
Feb 26, 2021, 2:53:15 PM2/26/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: new
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"8908846444156eeae88be70332f96759cfce7740" 8908846]:
{{{
#!CommitTicketReference repository=""
revision="8908846444156eeae88be70332f96759cfce7740"
Refs #32292 -- Made dbshell do not use 'postgres' database when service
name is set.

Regression in dcb3ad3319cad5c270a1856fd5f355e37cf9d474.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:16>

Django

unread,
Feb 26, 2021, 2:53:56 PM2/26/21
to django-...@googlegroups.com
#32292: Allow postgresql database connections to use postgres services
-------------------------------------+-------------------------------------
Reporter: levihb | Owner: Hasan
| Ramezani
Type: New feature | Status: closed

Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: database postgresql | Triage Stage: Accepted
postgres service pg_service |
config |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/32292#comment:17>

Reply all
Reply to author
Forward
0 new messages