Обсуждение: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

Поиск
Список
Период
Сортировка

CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Fabrízio de Royes Mello
Дата:
Hi all,

We already have IF NOT EXISTS for CREATE TABLE. There are some reason to don't have to CREATE TABLE AS and CREATE MATERIALIZED VIEW??

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Fabrízio de Royes Mello
Дата:
On Wed, Oct 1, 2014 at 9:17 AM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote:
>
> Hi all,
>
> We already have IF NOT EXISTS for CREATE TABLE. There are some reason to don't have to CREATE TABLE AS and CREATE MATERIALIZED VIEW??
>

Patch attached to add CINE support to:

- CREATE TABLE AS
- CREATE MATERIALIZED VIEW

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello
Вложения

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Rushabh Lathia
Дата:
<div dir="ltr">Hi All,<br /><br />- Patch got applied cleanly.<br />- Regression make check run fine.<br />- Patch
coveredthe documentation changes<br /><br />Here are few comments:<br /><br />1) What the need of following change:<br
/><br/>diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c<br />index bcec173..9fe6855
100644<br/>--- a/src/backend/storage/lmgr/lwlock.c<br />+++ b/src/backend/storage/lmgr/lwlock.c<br />@@ -1005,12
+1005,6@@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)<br />             lock->tail
=proc;<br />         lock->head = proc;<br /> <br />-        /*<br />-         * Set releaseOK, to make sure we get
wokenup as soon as the lock is<br />-         * released.<br />-         */<br />-        lock->releaseOK = true;<br
/>-<br/>         /* Can release the mutex now */<br />         SpinLockRelease(&lock->mutex);<br /> <br /><br
/>Itdoesn't look like related to this patch.<br /><br />2) <br /><br />diff --git a/src/bin/psql/help.c
b/src/bin/psql/help.c<br/>index ae5fe88..4d11952 100644<br />--- a/src/bin/psql/help.c<br />+++
b/src/bin/psql/help.c<br/>@@ -247,7 +247,7 @@ slashUsage(unsigned short int pager)<br />     fprintf(output, _("  \\f
[STRING]           show or set field separator for unaligned query output\n"));<br />     fprintf(output, _(" 
\\H                    toggle HTML output mode (currently %s)\n"),<br />             ON(pset.popt.topt.format ==
PRINT_HTML));<br/>-    fprintf(output, _("  \\pset [NAME [VALUE]]   set table output option\n"<br />+   
fprintf(output,_("  \\pset [NAME [VALUE]]     set table output option\n"<br />                      
"                        (NAME := {format|border|expanded|fieldsep|fieldsep_zero|footer|null|\n"<br />                
     "                         numericlocale|recordsep|recordsep_zero|tuples_only|title|tableattr|pager|\n"<br />    
                 "                        
unicode_border_linestyle|unicode_column_linestyle|unicode_header_linestyle})\n"));<br/><br /><br />Why above changes
reqired?<br /><br />3) This patch adding IF NOT EXIST_S for CREATE TABLE AS and CREATE MATERIALIZED<br />TABLE, but
testcasecoverage for CREATE MATERIALIZED TABLE is missing.<br /><br />Apart from this changes looks good to me.<br
/><br/></div><div class="gmail_extra"><br /><div class="gmail_quote">On Tue, Oct 14, 2014 at 10:28 PM, Fabrízio de
RoyesMello <span dir="ltr"><<a href="mailto:fabriziomello@gmail.com"
target="_blank">fabriziomello@gmail.com</a>></span>wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px#ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class="">On Wed, Oct 1,
2014at 9:17 AM, Fabrízio de Royes Mello <<a href="mailto:fabriziomello@gmail.com"
target="_blank">fabriziomello@gmail.com</a>>wrote:<br />><br />> Hi all,<br />><br />> We already have
IFNOT EXISTS for CREATE TABLE. There are some reason to don't have to CREATE TABLE AS and CREATE MATERIALIZED VIEW??<br
/>><br/><br /></span>Patch attached to add CINE support to:<br /><br />- CREATE TABLE AS<br />- CREATE MATERIALIZED
VIEW<spanclass=""><br /><br />Regards,<br /><br />--<br />Fabrízio de Royes Mello<br />Consultoria/Coaching
PostgreSQL<br/>>> Timbira: <a href="http://www.timbira.com.br" target="_blank">http://www.timbira.com.br</a><br
/>>>Blog: <a href="http://fabriziomello.github.io" target="_blank">http://fabriziomello.github.io</a><br
/>>>Linkedin: <a href="http://br.linkedin.com/in/fabriziomello"
target="_blank">http://br.linkedin.com/in/fabriziomello</a><br/>>> Twitter: <a
href="http://twitter.com/fabriziomello"target="_blank">http://twitter.com/fabriziomello</a><br />>> Github: <a
href="http://github.com/fabriziomello"target="_blank">http://github.com/fabriziomello</a></span></div></div><br /><br
/>--<br /> Sent via pgsql-hackers mailing list (<a
href="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br/> To make changes to your
subscription:<br/><a href="http://www.postgresql.org/mailpref/pgsql-hackers"
target="_blank">http://www.postgresql.org/mailpref/pgsql-hackers</a><br/><br /></blockquote></div><br /><br clear="all"
/><br/>-- <br />Rushabh Lathia </div> 

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Fabrízio de Royes Mello
Дата:


On Mon, Oct 27, 2014 at 4:15 AM, Rushabh Lathia <rushabh.lathia@gmail.com> wrote:
>
> Hi All,
>
> - Patch got applied cleanly.
> - Regression make check run fine.
> - Patch covered the documentation changes
>
> Here are few comments:
>
> 1) What the need of following change:
>
> diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
> index bcec173..9fe6855 100644
> --- a/src/backend/storage/lmgr/lwlock.c
> +++ b/src/backend/storage/lmgr/lwlock.c
> @@ -1005,12 +1005,6 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
>              lock->tail = proc;
>          lock->head = proc;
>  
> -        /*
> -         * Set releaseOK, to make sure we get woken up as soon as the lock is
> -         * released.
> -         */
> -        lock->releaseOK = true;
> -
>          /* Can release the mutex now */
>          SpinLockRelease(&lock->mutex);
>  
>
> It doesn't look like related to this patch.
>

Sorry... my mistake when diff to master (more updated than my branch).

Fixed.


> 2)
>
> diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
> index ae5fe88..4d11952 100644
> --- a/src/bin/psql/help.c
> +++ b/src/bin/psql/help.c
> @@ -247,7 +247,7 @@ slashUsage(unsigned short int pager)
>      fprintf(output, _("  \\f [STRING]            show or set field separator for unaligned query output\n"));
>      fprintf(output, _("  \\H                     toggle HTML output mode (currently %s)\n"),
>              ON(pset.popt.topt.format == PRINT_HTML));
> -    fprintf(output, _("  \\pset [NAME [VALUE]]   set table output option\n"
> +    fprintf(output, _("  \\pset [NAME [VALUE]]     set table output option\n"
>                        "                         (NAME := {format|border|expanded|fieldsep|fieldsep_zero|footer|null|\n"
>                        "                         numericlocale|recordsep|recordsep_zero|tuples_only|title|tableattr|pager|\n"
>                        "                         unicode_border_linestyle|unicode_column_linestyle|unicode_header_linestyle})\n"));
>
>
> Why above changes reqired ?
>

Same previous mistake.

Fixed.


> 3) This patch adding IF NOT EXIST_S for CREATE TABLE AS and CREATE MATERIALIZED
> TABLE, but testcase coverage for CREATE MATERIALIZED TABLE is missing.
>
> Apart from this changes looks good to me.
>

Fixed.

Thanks for your review.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello
Вложения

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Rushabh Lathia
Дата:
Patch looks good, assigning to committer.

On Fri, Oct 31, 2014 at 8:36 AM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote:


On Mon, Oct 27, 2014 at 4:15 AM, Rushabh Lathia <rushabh.lathia@gmail.com> wrote:
>
> Hi All,
>
> - Patch got applied cleanly.
> - Regression make check run fine.
> - Patch covered the documentation changes
>
> Here are few comments:
>
> 1) What the need of following change:
>
> diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
> index bcec173..9fe6855 100644
> --- a/src/backend/storage/lmgr/lwlock.c
> +++ b/src/backend/storage/lmgr/lwlock.c
> @@ -1005,12 +1005,6 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
>              lock->tail = proc;
>          lock->head = proc;
>  
> -        /*
> -         * Set releaseOK, to make sure we get woken up as soon as the lock is
> -         * released.
> -         */
> -        lock->releaseOK = true;
> -
>          /* Can release the mutex now */
>          SpinLockRelease(&lock->mutex);
>  
>
> It doesn't look like related to this patch.
>

Sorry... my mistake when diff to master (more updated than my branch).

Fixed.


> 2)
>
> diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
> index ae5fe88..4d11952 100644
> --- a/src/bin/psql/help.c
> +++ b/src/bin/psql/help.c
> @@ -247,7 +247,7 @@ slashUsage(unsigned short int pager)
>      fprintf(output, _("  \\f [STRING]            show or set field separator for unaligned query output\n"));
>      fprintf(output, _("  \\H                     toggle HTML output mode (currently %s)\n"),
>              ON(pset.popt.topt.format == PRINT_HTML));
> -    fprintf(output, _("  \\pset [NAME [VALUE]]   set table output option\n"
> +    fprintf(output, _("  \\pset [NAME [VALUE]]     set table output option\n"
>                        "                         (NAME := {format|border|expanded|fieldsep|fieldsep_zero|footer|null|\n"
>                        "                         numericlocale|recordsep|recordsep_zero|tuples_only|title|tableattr|pager|\n"
>                        "                         unicode_border_linestyle|unicode_column_linestyle|unicode_header_linestyle})\n"));
>
>
> Why above changes reqired ?
>

Same previous mistake.

Fixed.


> 3) This patch adding IF NOT EXIST_S for CREATE TABLE AS and CREATE MATERIALIZED
> TABLE, but testcase coverage for CREATE MATERIALIZED TABLE is missing.
>
> Apart from this changes looks good to me.
>

Fixed.

Thanks for your review.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello



--
Rushabh Lathia

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Fabrízio de Royes Mello
Дата:
<div dir="ltr"><div class="gmail_extra">On Mon, Nov 3, 2014 at 3:12 AM, Rushabh Lathia <<a
href="mailto:rushabh.lathia@gmail.com">rushabh.lathia@gmail.com</a>>wrote:<br />><br />> Patch looks good,
assigningto committer.<br />><br /><br />Thanks for your review!<br /><br />--<br />Fabrízio de Royes Mello<br
/>Consultoria/CoachingPostgreSQL<br />>> Timbira: <a
href="http://www.timbira.com.br">http://www.timbira.com.br</a><br/>>> Blog: <a
href="http://fabriziomello.github.io">http://fabriziomello.github.io</a><br/>>> Linkedin: <a
href="http://br.linkedin.com/in/fabriziomello">http://br.linkedin.com/in/fabriziomello</a><br/>>> Twitter: <a
href="http://twitter.com/fabriziomello">http://twitter.com/fabriziomello</a><br/>>> Github: <a
href="http://github.com/fabriziomello">http://github.com/fabriziomello</a></div></div>

Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Andrew Dunstan
Дата:
On 11/03/2014 07:35 AM, Fabrízio de Royes Mello wrote:
> On Mon, Nov 3, 2014 at 3:12 AM, Rushabh Lathia
> <rushabh.lathia@gmail.com <mailto:rushabh.lathia@gmail.com>> wrote:
> >
> > Patch looks good, assigning to committer.
> >
>
> Thanks for your review!
>


Committed.

cheers

andrew



Re: CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

От
Fabrízio de Royes Mello
Дата:


Em sábado, 13 de dezembro de 2014, Andrew Dunstan <andrew@dunslane.net> escreveu:

On 11/03/2014 07:35 AM, Fabrízio de Royes Mello wrote:
On Mon, Nov 3, 2014 at 3:12 AM, Rushabh Lathia <rushabh.lathia@gmail.com <mailto:rushabh.lathia@gmail.com>> wrote:
>
> Patch looks good, assigning to committer.
>

Thanks for your review!



Committed.


Thanks. 

Fabrízio 


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL