Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Xing Guo
On Tue, Feb 27, 2024 at 6:38 AM Stephen Frost wrote: > > Greetings, > > * Xing Guo (higuox...@gmail.com) wrote: > > Looks that many hackers are happy with the original patch except that > > the original patch needs a simple rebase, though it has been 3 years. > > I'm not completely against the

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Stephen Frost
Greetings, * Xing Guo (higuox...@gmail.com) wrote: > Looks that many hackers are happy with the original patch except that > the original patch needs a simple rebase, though it has been 3 years. I'm not completely against the idea of adding these hooks, but I have to say that it's unfortunate to

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2024-02-26 Thread Xing Guo
On Mon, Feb 26, 2024 at 7:27 PM Daniel Gustafsson wrote: > > > On 1 Jul 2020, at 10:36, Daniel Gustafsson wrote: > > > >> On 27 Mar 2020, at 11:22, Haozhou Wang wrote: > > > >> We rebased this patch with the newest master. > > > > This patch now fails to build according to Travis: > > > >

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2020-07-31 Thread Daniel Gustafsson
> On 1 Jul 2020, at 10:36, Daniel Gustafsson wrote: > >> On 27 Mar 2020, at 11:22, Haozhou Wang wrote: > >> We rebased this patch with the newest master. > > This patch now fails to build according to Travis: > > smgr.c: In function ‘smgrtruncate’: > smgr.c:578:47: error: passing argument 4

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2020-07-01 Thread Daniel Gustafsson
> On 27 Mar 2020, at 11:22, Haozhou Wang wrote: > We rebased this patch with the newest master. This patch now fails to build according to Travis: smgr.c: In function ‘smgrtruncate’: smgr.c:578:47: error: passing argument 4 of ‘smgrtruncate_hook’ makes integer from pointer without a cast

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2020-03-27 Thread Haozhou Wang
Thanks David! We rebased this patch with the newest master. Thank you very much! Regards, Haozhou On Wed, Mar 25, 2020 at 12:00 AM David Steele wrote: > On 12/2/19 1:39 AM, Haozhou Wang wrote: > > > > Thank you very much for your email. I rebased the code with the newest > > master and

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2020-03-24 Thread David Steele
On 12/2/19 1:39 AM, Haozhou Wang wrote: Thank you very much for your email. I rebased the code with the newest master and attached it in the attachment. This patch applies but no longer builds on Linux or Windows: https://travis-ci.org/github/postgresql-cfbot/postgresql/builds/666113036

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-12-01 Thread Haozhou Wang
Hi Michael, Thank you very much for your email. I rebased the code with the newest master and attached it in the attachment. Thank you very much! Regards, Haozhou On Sun, Dec 1, 2019 at 11:20 AM Michael Paquier wrote: > On Fri, Sep 27, 2019 at 11:30:08AM +0800, Haozhou Wang wrote: > > I

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-11-30 Thread Michael Paquier
On Fri, Sep 27, 2019 at 11:30:08AM +0800, Haozhou Wang wrote: > I rebased this patch with the newest master branch. Attached the new > patch disk_quota_hooks_v5.patch in the attachment. This again needs a rebase, so I have switched it as waiting on author. -- Michael signature.asc Description:

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-09-26 Thread Haozhou Wang
Thanks Alvaro! I rebased this patch with the newest master branch. Attached the new patch disk_quota_hooks_v5.patch in the attachment. Regards, Haozhou On Thu, Sep 26, 2019 at 3:54 AM Alvaro Herrera wrote: > This patch no longer applies. Can you please rebase? > > -- > Álvaro Herrera >

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-09-25 Thread Alvaro Herrera
This patch no longer applies. Can you please rebase? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-07-14 Thread Hubert Zhang
Thanks, Thomas. On Mon, Jul 8, 2019 at 6:47 AM Thomas Munro wrote: > On Mon, Feb 18, 2019 at 7:39 PM Hubert Zhang wrote: > > Based on the assumption we use smgr as hook position, hook API option1 > or option2 which is better? > > Or we could find some balanced API between option1 and option2?

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-07-07 Thread Thomas Munro
On Mon, Feb 18, 2019 at 7:39 PM Hubert Zhang wrote: > Based on the assumption we use smgr as hook position, hook API option1 or > option2 which is better? > Or we could find some balanced API between option1 and option2? > > Again comments on other better hook positions are also appreciated! Hi

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-02-17 Thread Hubert Zhang
Hi Andres On Sat, Feb 16, 2019 at 12:53 PM Andres Freund wrote: > Hi, > On 2019-01-30 10:26:52 +0800, Hubert Zhang wrote: > > Hi Michael, Robert > > For you question about the hook position, I want to explain more about > the > > background why we want to introduce these hooks. > > We wrote a

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-02-15 Thread Andres Freund
Hi, On 2019-01-30 10:26:52 +0800, Hubert Zhang wrote: > Hi Michael, Robert > For you question about the hook position, I want to explain more about the > background why we want to introduce these hooks. > We wrote a diskquota extension > [ ...] > On

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-01-30 Thread Hubert Zhang
Hi all, Currently we add hooks in SMGR to detect which table is being modified(disk size change). Inserting rows into existing page with room will not introduce new block, and thus should not be treated as active table. smgrextend is a good position to meet this behavior. We welcome suggestions

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-01-29 Thread Hubert Zhang
Hi Michael, Robert For you question about the hook position, I want to explain more about the background why we want to introduce these hooks. We wrote a diskquota extension for Postgresql(which is inspired by Heikki's pg_quota

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-01-21 Thread Hubert Zhang
> > > For this particular purpose, I don't immediately see why you need a > > hook in both places. If ReadBuffer is called with P_NEW, aren't we > > guaranteed to end up in smgrextend()? > Yes, that's a bit awkward. Hi Michael, we revisit the ReadBuffer hook and remove it in the latest patch.

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-01-07 Thread Haozhou Wang
Thanks very much for your comments. To the best of my knowledge, smgr is a layer that abstract the storage operations. Therefore, it is a good place to control or collect information the storage operations without touching the physical storage layer. Moreover, smgr is coming with actual disk IO

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-22 Thread Hubert Zhang
> > For this particular purpose, I don't immediately see why you need a > hook in both places. If ReadBuffer is called with P_NEW, aren't we > guaranteed to end up in smgrextend()? For the usercase in diskquota. BufferExtendCheckPerms_hook is used to do dynamic query enforcement, while smgr

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-22 Thread Haozhou Wang
Thank you very much for your review. We refactored our patch with new names and comments. For ReadBufferExtended hook, yes, Readbuffer with P_NEW will then call smgrextend. But in smgrextend, we cannot get the oid of a relation, and it will take some time to get the oid via smgrrelation. We

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-21 Thread Robert Haas
On Tue, Nov 20, 2018 at 2:20 AM Haozhou Wang wrote: > We prepared a patch that includes the hook points. And such hook points are > needed for disk quota extension. > There are two hooks. > One is SmgrStat_hook. It's used to perform ad-hoc logic in storage when doing > smgr

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-19 Thread Haozhou Wang
Hi all, We prepared a patch that includes the hook points. And such hook points are needed for disk quota extension. There are two hooks. One is SmgrStat_hook. It's used to perform ad-hoc logic in storage when doing smgr create/extend/truncate in general. As for disk quota extension, this hook is

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-14 Thread Hubert Zhang
Thanks, Tomas, Yes, we want to add the hooks into postgres repo. But before that, we plan to firstly get some feedbacks from community about the diskquota extension implementation and usage? Later, we'll modify our license and submit the hooks into CF. Thanks Hubert On Wed, Nov 14, 2018 at 3:54

Control your disk usage in PG: Introduction to Disk Quota Extension

2018-11-13 Thread Hubert Zhang
Hi all, We implement disk quota feature on Postgresql as an extension(link: https://github.com/greenplum-db/diskquota), If you are interested, try and use it to limit the amount of disk space that a schema or a role can use in Postgresql. Any feedback or question are appreciated. Overview