pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedReport bug!
5+ messages / 5 participants
[nested] [flat]
* Report bug!
@ 2020-01-06 10:22 f的梦 <1728565484@qq.com>
0 siblings, 1 reply; 5+ messages in thread
From: f的梦 @ 2020-01-06 10:22 UTC (permalink / raw)
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
I want to report a bug for PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
I can't create account, so I can only send it here.
/copy command will not trigger increament of a table's pk.
How I get this problem?
```
\copy one_off_coupon(payload,tag, expire_at) from '/tmp/ldj.csv' delimiter as ',' csv quote as '"';
```
```
select * from one_off_coupon
```
The list is success loaded and id correct ranged 1-7000.
OK, Here is the problem:
When I try `insert into one_off_coupon(payload) values('111')`, it reports error `pk brabra conflict`.
Then I print
```
select nextval('one_off_coupon_id_seq');
```
It is `47`,so far away from 7000.
!!!!!!!!!!!!!
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Report bug!
@ 2020-01-06 13:52 Tomas Vondra <tomas.vondra@2ndquadrant.com>
parent: f的梦 <1728565484@qq.com>
0 siblings, 0 replies; 5+ messages in thread
From: Tomas Vondra @ 2020-01-06 13:52 UTC (permalink / raw)
To: f的梦 <1728565484@qq.com>; +Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
On Mon, Jan 06, 2020 at 06:22:53PM +0800, f的梦 wrote:
>I want to report a bug for PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
>
>I can't create account, so I can only send it here.
>
>
>/copy command will not trigger increament of a table's pk.
>
>
>How I get this problem?
>
>
>```
> \copy one_off_coupon(payload,tag, expire_at) from '/tmp/ldj.csv' delimiter as ',' csv quote as '"';
>```
>
>
>```
>select * from one_off_coupon
>```
>
>
>The list is success loaded and id correct ranged 1-7000.
>
>
>OK, Here is the problem:
>
>
>When I try `insert into one_off_coupon(payload) values('111')`, it reports error `pk brabra conflict`.
>
>
>Then I print
>```
>select nextval('one_off_coupon_id_seq');
>```
>It is `47`,so far away from 7000.
>
I think we need to see '\d one_off_coupon'.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
* report bug
@ 2020-04-30 11:36 断桥烟雨三两月 <1310659646@qq.com>
0 siblings, 1 reply; 5+ messages in thread
From: 断桥烟雨三两月 @ 2020-04-30 11:36 UTC (permalink / raw)
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
As is shown,I login as u-mx_3 (CREATEROLE,NOCREATEDB),and I can't create DB;
However,I can create a role with the pri CREATEDB,and it works!!
So, why a role with NOCREATEDB can create a role who can create DB?
Attachments:
3006E80D@9FADBD5D.49B8AA5E.jpg (image/jpeg, 71.3K) download
view image
3004EA0B@29547E6E.49B8AA5E.jpg (image/jpeg, 54.1K) download
view image
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: report bug
@ 2020-04-30 13:06 David G. Johnston <david.g.johnston@gmail.com>
parent: 断桥烟雨三两月 <1310659646@qq.com>
0 siblings, 1 reply; 5+ messages in thread
From: David G. Johnston @ 2020-04-30 13:06 UTC (permalink / raw)
To: 断桥烟雨三两月 <1310659646@qq.com>; +Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
>
>
> So, why a role with NOCREATEDB can create a role who can create DB?
>
Cannot answer why but given it is documented as working this way this isn’t
a bug.
“ Be careful with the CREATEROLE privilege. There is no concept of
inheritance for the privileges of a CREATEROLE-role. That means that even
if a role does not have a certain privilege but is allowed to create other
roles, it can easily create another role with different privileges than its
own (except for creating roles with superuser privileges)”
https://www.postgresql.org/docs/12/sql-createrole.html
David J.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: report bug
@ 2020-04-30 13:47 Tom Lane <tgl@sss.pgh.pa.us>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2020-04-30 13:47 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: 断桥烟雨三两月 <1310659646@qq.com>; pgsql-bugs <pgsql-bugs@lists.postgresql.org>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
>> So, why a role with NOCREATEDB can create a role who can create DB?
> Cannot answer why but given it is documented as working this way this isn’t
> a bug.
Yeah, that's deliberate. CREATEROLE is intended to be sufficient
privilege for all day-to-day user/role administration, so that you
don't have to use a superuser bit for that. The only restriction
on it is you can't manufacture new superuser roles ... but you
definitely can manufacture roles that have other privileges you
don't have yourself. In particular, a CREATEROLE role can issue
GRANTs for privileges it doesn't have itself; so the behavior with
respect to CREATEDB isn't different from that.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2020-04-30 13:47 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 10:22 Report bug! f的梦 <1728565484@qq.com>
2020-01-06 13:52 ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2020-04-30 11:36 report bug 断桥烟雨三两月 <1310659646@qq.com>
2020-04-30 13:06 ` Re: report bug David G. Johnston <david.g.johnston@gmail.com>
2020-04-30 13:47 ` Re: report bug Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox