Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
98b3c3c4
Commit
98b3c3c4
authored
19 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Allow CREATE/ALTER ROLE PASSWORD NULL to allow restoring the default state
of having no password.
parent
dcc7da8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/src/sgml/ref/create_role.sgml
+8
-5
8 additions, 5 deletions
doc/src/sgml/ref/create_role.sgml
src/backend/commands/user.c
+11
-4
11 additions, 4 deletions
src/backend/commands/user.c
src/backend/parser/gram.y
+5
-1
5 additions, 1 deletion
src/backend/parser/gram.y
with
24 additions
and
10 deletions
doc/src/sgml/ref/create_role.sgml
+
8
−
5
View file @
98b3c3c4
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.
5
2005/12/
18 02:17:16
petere Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_role.sgml,v 1.
6
2005/12/
23 16:46:39
petere Exp $
PostgreSQL documentation
-->
...
...
@@ -188,10 +188,13 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
<listitem>
<para>
Sets the role's password. (A password is only of use for
roles having the <literal>LOGIN</literal> attribute, but you can
nonetheless define one for roles without it.)
If you do not plan to use password
authentication you can omit this option.
roles having the <literal>LOGIN</literal> attribute, but you
can nonetheless define one for roles without it.) If you do
not plan to use password authentication you can omit this
option. If no password is specified, the password will be set
to null and password authentication will always fail for that
user. A null password can optionally be written explicitly as
<literal>PASSWORD NULL</literal>.
</para>
</listitem>
</varlistentry>
...
...
This diff is collapsed.
Click to expand it.
src/backend/commands/user.c
+
11
−
4
View file @
98b3c3c4
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.16
6
2005/1
1
/2
2
1
8:17:09 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.16
7
2005/1
2
/2
3
1
6:46:39 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -225,7 +225,7 @@ CreateRole(CreateRoleStmt *stmt)
defel
->
defname
);
}
if
(
dpassword
)
if
(
dpassword
&&
dpassword
->
arg
)
password
=
strVal
(
dpassword
->
arg
);
if
(
dissuper
)
issuper
=
intVal
(
dissuper
->
arg
)
!=
0
;
...
...
@@ -517,7 +517,7 @@ AlterRole(AlterRoleStmt *stmt)
defel
->
defname
);
}
if
(
dpassword
)
if
(
dpassword
&&
dpassword
->
arg
)
password
=
strVal
(
dpassword
->
arg
);
if
(
dissuper
)
issuper
=
intVal
(
dissuper
->
arg
);
...
...
@@ -573,7 +573,7 @@ AlterRole(AlterRoleStmt *stmt)
!
dconnlimit
&&
!
rolemembers
&&
!
validUntil
&&
password
&&
d
password
&&
roleid
==
GetUserId
()))
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
...
@@ -651,6 +651,13 @@ AlterRole(AlterRoleStmt *stmt)
new_record_repl
[
Anum_pg_authid_rolpassword
-
1
]
=
'r'
;
}
/* unset password */
if
(
dpassword
&&
dpassword
->
arg
==
NULL
)
{
new_record_repl
[
Anum_pg_authid_rolpassword
-
1
]
=
'r'
;
new_record_nulls
[
Anum_pg_authid_rolpassword
-
1
]
=
'n'
;
}
/* valid until */
if
(
validUntil
)
{
...
...
This diff is collapsed.
Click to expand it.
src/backend/parser/gram.y
+
5
−
1
View file @
98b3c3c4
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.51
7
2005/12/
11 10:54:27 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.51
8
2005/12/
23 16:46:39 petere
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -616,6 +616,10 @@ OptRoleElem:
$$ = makeDefElem("password",
(Node *)makeString($2));
}
| PASSWORD NULL_P
{
$$ = makeDefElem("password", NULL);
}
| ENCRYPTED PASSWORD Sconst
{
$$ = makeDefElem("encryptedPassword",
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment