pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Truncate View
8+ messages / 4 participants
[nested] [flat]

* Truncate View
@ 2021-01-13 21:22 PG Doc comments form <noreply@postgresql.org>
  0 siblings, 0 replies; 8+ messages in thread

From: PG Doc comments form @ 2021-01-13 21:22 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: adaptron@comcast.net

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/plpgsql-trigger.html
Description:

http://bit.ly/1w5ISeU
This states that all ON triggers are at the row level
I am trying to find details on how ON TRUNCATE will work for a view.
I understand that the trigger must be table level but have been unable to
find details.
Please add a truncate view example.
Thanks
Dave


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* TRUNCATE VIEW
@ 2021-01-25 12:06 PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 8+ messages in thread

From: PG Doc comments form @ 2021-01-25 12:06 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: harisai.58@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/ddl-priv.html
Description:

Dear Team,

In this link https://www.postgresql.org/docs/12/ddl-priv.html you mentioned
like Truncate of view, Is it possible?

TRUNCATE
Allows TRUNCATE on a table, view, etc.


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
@ 2021-01-25 12:38 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Laurenz Albe @ 2021-01-25 12:38 UTC (permalink / raw)
  To: harisai.58@gmail.com; pgsql-docs@lists.postgresql.org

On Mon, 2021-01-25 at 12:06 +0000, PG Doc comments form wrote:
> In this link https://www.postgresql.org/docs/12/ddl-priv.html you mentioned
> like Truncate of view, Is it possible?
> 
> TRUNCATE
> Allows TRUNCATE on a table, view, etc.

Yes, if you define an INSTEAD OF TRUNCATE trigger on the view.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-01-25 13:15   ` harisai hari <harisai.58@gmail.com>
  2021-01-25 15:22     ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 8+ messages in thread

From: harisai hari @ 2021-01-25 13:15 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org

Could you please provide documentation link, I couldn't find it.

On Mon, 25 Jan 2021, 6:08 pm Laurenz Albe, <laurenz.albe@cybertec.at> wrote:

> On Mon, 2021-01-25 at 12:06 +0000, PG Doc comments form wrote:
> > In this link https://www.postgresql.org/docs/12/ddl-priv.html you
> mentioned
> > like Truncate of view, Is it possible?
> >
> > TRUNCATE
> > Allows TRUNCATE on a table, view, etc.
>
> Yes, if you define an INSTEAD OF TRUNCATE trigger on the view.
>
> Yours,
> Laurenz Albe
>
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
@ 2021-01-25 15:22     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 15:23       ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Laurenz Albe @ 2021-01-25 15:22 UTC (permalink / raw)
  To: harisai hari <harisai.58@gmail.com>; +Cc: pgsql-docs@lists.postgresql.org

On Mon, 2021-01-25 at 18:45 +0530, harisai hari wrote:
> 
> On Mon, 25 Jan 2021, 6:08 pm Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
> > On Mon, 2021-01-25 at 12:06 +0000, PG Doc comments form wrote:
> > > In this link https://www.postgresql.org/docs/12/ddl-priv.html you mentioned
> > > like Truncate of view, Is it possible?
> > > 
> > > TRUNCATE
> > > Allows TRUNCATE on a table, view, etc.
> > 
> > Yes, if you define an INSTEAD OF TRUNCATE trigger on the view.
>
> Could you please provide documentation link, I couldn't find it.

Checking again, I realize that I wrote nonsense, and you are right.

I concur that this should be simplified to

  Allows TRUNCATE on a table.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  2021-01-25 15:22     ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-01-25 15:23       ` harisai hari <harisai.58@gmail.com>
  2021-01-26 00:54         ` Re: TRUNCATE VIEW Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 8+ messages in thread

From: harisai hari @ 2021-01-25 15:23 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org

Thank you!

On Mon, 25 Jan 2021, 8:53 pm Laurenz Albe, <laurenz.albe@cybertec.at> wrote:

> On Mon, 2021-01-25 at 18:45 +0530, harisai hari wrote:
> >
> > On Mon, 25 Jan 2021, 6:08 pm Laurenz Albe, <laurenz.albe@cybertec.at>
> wrote:
> > > On Mon, 2021-01-25 at 12:06 +0000, PG Doc comments form wrote:
> > > > In this link https://www.postgresql.org/docs/12/ddl-priv.html you
> mentioned
> > > > like Truncate of view, Is it possible?
> > > >
> > > > TRUNCATE
> > > > Allows TRUNCATE on a table, view, etc.
> > >
> > > Yes, if you define an INSTEAD OF TRUNCATE trigger on the view.
> >
> > Could you please provide documentation link, I couldn't find it.
>
> Checking again, I realize that I wrote nonsense, and you are right.
>
> I concur that this should be simplified to
>
>   Allows TRUNCATE on a table.
>
> Yours,
> Laurenz Albe
>
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  2021-01-25 15:22     ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 15:23       ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
@ 2021-01-26 00:54         ` Michael Paquier <michael@paquier.xyz>
  2021-01-27 04:44           ` Re: TRUNCATE VIEW Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 8+ messages in thread

From: Michael Paquier @ 2021-01-26 00:54 UTC (permalink / raw)
  To: harisai hari <harisai.58@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-docs@lists.postgresql.org

On Mon, Jan 25, 2021 at 08:53:39PM +0530, harisai hari wrote:
> Thank you!

Yes, this page is wrong to tell that.  There is a second thing that
I find confusing in the docs of TRUNCATE:
https://www.postgresql.org/docs/devel/sql-truncate.html

This does not mention at all partitioned tables, describing only
"descendant tables".  Partitioning is a case of "descendant tables"
but that's a bit confusing IMO and a reader would need to guess that.

Thoughts?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: TRUNCATE VIEW
  2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
  2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  2021-01-25 15:22     ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
  2021-01-25 15:23       ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
  2021-01-26 00:54         ` Re: TRUNCATE VIEW Michael Paquier <michael@paquier.xyz>
@ 2021-01-27 04:44           ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 8+ messages in thread

From: Michael Paquier @ 2021-01-27 04:44 UTC (permalink / raw)
  To: harisai hari <harisai.58@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-docs@lists.postgresql.org

On Tue, Jan 26, 2021 at 09:54:48AM +0900, Michael Paquier wrote:
> Yes, this page is wrong to tell that.

This one has been fixed with 32bef75 down to 12.

> There is a second thing that I find confusing in the docs of
> TRUNCATE:
> https://www.postgresql.org/docs/devel/sql-truncate.html
>
> This does not mention at all partitioned tables, describing only
> "descendant tables".  Partitioning is a case of "descendant tables"
> but that's a bit confusing IMO and a reader would need to guess that.

Not sure what to do about this part yet.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2021-01-27 04:44 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 21:22 Truncate View PG Doc comments form <noreply@postgresql.org>
2021-01-25 12:06 TRUNCATE VIEW PG Doc comments form <noreply@postgresql.org>
2021-01-25 12:38 ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
2021-01-25 13:15   ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
2021-01-25 15:22     ` Re: TRUNCATE VIEW Laurenz Albe <laurenz.albe@cybertec.at>
2021-01-25 15:23       ` Re: TRUNCATE VIEW harisai hari <harisai.58@gmail.com>
2021-01-26 00:54         ` Re: TRUNCATE VIEW Michael Paquier <michael@paquier.xyz>
2021-01-27 04:44           ` Re: TRUNCATE VIEW Michael Paquier <michael@paquier.xyz>

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