Re: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-12-13 Thread 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.lat...@gmail.com mailto:rushabh.lat...@gmail.com wrote:


 Patch looks good, assigning to committer.


Thanks for your review!




Committed.

cheers

andrew


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-12-13 Thread Fabrízio de Royes Mello
Em sábado, 13 de dezembro de 2014, Andrew Dunstan and...@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.lat...@gmail.com
 mailto:rushabh.lat...@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
 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: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-11-03 Thread Fabrízio de Royes Mello
On Mon, Nov 3, 2014 at 3:12 AM, Rushabh Lathia rushabh.lat...@gmail.com
wrote:

 Patch looks good, assigning to committer.


Thanks for your review!

--
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: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-11-02 Thread Rushabh Lathia
Patch looks good, assigning to committer.

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



 On Mon, Oct 27, 2014 at 4:15 AM, Rushabh Lathia rushabh.lat...@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: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-10-30 Thread Fabrízio de Royes Mello
On Mon, Oct 27, 2014 at 4:15 AM, Rushabh Lathia rushabh.lat...@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
diff --git a/doc/src/sgml/ref/create_materialized_view.sgml b/doc/src/sgml/ref/create_materialized_view.sgml
index 2c73852..8a0fb4d 100644
--- a/doc/src/sgml/ref/create_materialized_view.sgml
+++ b/doc/src/sgml/ref/create_materialized_view.sgml
@@ -21,7 +21,7 @@ PostgreSQL documentation
 
  refsynopsisdiv
 synopsis
-CREATE MATERIALIZED VIEW replaceabletable_name/replaceable
+CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] replaceabletable_name/replaceable
 [ (replaceablecolumn_name/replaceable [, ...] ) ]
 [ WITH ( replaceable class=PARAMETERstorage_parameter/replaceable [= replaceable class=PARAMETERvalue/replaceable] [, ... ] ) ]
 [ TABLESPACE replaceable class=PARAMETERtablespace_name/replaceable ]
@@ -53,6 +53,18 @@ CREATE MATERIALIZED VIEW replaceabletable_name/replaceable
  refsect1
   titleParameters/title
 
+   varlistentry
+termliteralIF NOT EXISTS//term
+listitem
+ para
+  Do not throw an error if a materialized view with the same name already
+  exists. A notice is issued in this case.  Note that there is no guarantee
+  that the existing materialized view is anything like the one that would
+  have been created.
+ /para
+/listitem
+   /varlistentry
+
   variablelist
varlistentry
 termreplaceabletable_name/replaceable/term
diff --git a/doc/src/sgml/ref/create_table_as.sgml b/doc/src/sgml/ref/create_table_as.sgml
index 60300ff..8e4ada7 100644
--- a/doc/src/sgml/ref/create_table_as.sgml
+++ b/doc/src/sgml/ref/create_table_as.sgml
@@ -21,7 +21,7 @@ PostgreSQL documentation
 
  refsynopsisdiv
 synopsis
-CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE replaceabletable_name/replaceable
+CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] replaceabletable_name/replaceable
 [ (replaceablecolumn_name/replaceable [, ...] ) ]
 [ WITH ( replaceable class=PARAMETERstorage_parameter/replaceable [= replaceable class=PARAMETERvalue/replaceable] [, ... ] ) | WITH OIDS | WITHOUT OIDS ]
 [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
@@ -91,6 +91,17 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE replaceable
/varlistentry
 
varlistentry
+termliteralIF NOT EXISTS//term
+listitem
+ para
+  Do not throw an error if a relation with the same name already exists.
+  A notice is issued in this case. Refer to xref linkend=sql-createtable
+  for details.
+ /para
+

Re: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-10-27 Thread Rushabh Lathia
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.

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 ?

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.


On Tue, Oct 14, 2014 at 10:28 PM, Fabrízio de Royes Mello 
fabriziome...@gmail.com wrote:

 On Wed, Oct 1, 2014 at 9:17 AM, Fabrízio de Royes Mello 
 fabriziome...@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


 --
 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-hackers




-- 
Rushabh Lathia


Re: [HACKERS] CINE in CREATE TABLE AS ... and CREATE MATERIALIZED VIEW ...

2014-10-14 Thread Fabrízio de Royes Mello
On Wed, Oct 1, 2014 at 9:17 AM, Fabrízio de Royes Mello 
fabriziome...@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
diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml
index 8e218ac..d53570d 100644
--- a/doc/src/sgml/bgworker.sgml
+++ b/doc/src/sgml/bgworker.sgml
@@ -192,7 +192,7 @@ typedef struct BackgroundWorker
opaque handle that can subsequently be passed to
functionGetBackgroundWorkerPid(parameterBackgroundWorkerHandle */parameter, parameterpid_t */parameter)/function or
functionTerminateBackgroundWorker(parameterBackgroundWorkerHandle */parameter)/function.
-   functionGetBackgroundWorkerPid/ can be used to poll the status of the
+   functionGetBackgroundWorker/ can be used to poll the status of the
worker: a return value of literalBGWH_NOT_YET_STARTED/ indicates that
the worker has not yet been started by the postmaster;
literalBGWH_STOPPED/literal indicates that it has been started but is
diff --git a/doc/src/sgml/ref/alter_view.sgml b/doc/src/sgml/ref/alter_view.sgml
index 3aef61b..cdcc4f1 100644
--- a/doc/src/sgml/ref/alter_view.sgml
+++ b/doc/src/sgml/ref/alter_view.sgml
@@ -28,6 +28,11 @@ ALTER VIEW [ IF EXISTS ] replaceable class=parametername/replaceable RENAM
 ALTER VIEW [ IF EXISTS ] replaceable class=parametername/replaceable SET SCHEMA replaceable class=parameternew_schema/replaceable
 ALTER VIEW [ IF EXISTS ] replaceable class=parametername/replaceable SET ( replaceable class=parameterview_option_name/replaceable [= replaceable class=parameterview_option_value/replaceable] [, ... ] )
 ALTER VIEW [ IF EXISTS ] replaceable class=parametername/replaceable RESET ( replaceable class=parameterview_option_name/replaceable [, ... ] )
+
+phrasewhere replaceable class=parameterview_option_name/replaceable can be one of:/phrase
+
+security_barrier [ replaceable class=parameterboolean/replaceable ]
+check_option [ replaceable class=parametertext/replaceable (literallocal/literal or literalcascaded/literal) ]
 /synopsis
  /refsynopsisdiv
 
@@ -117,32 +122,19 @@ ALTER VIEW [ IF EXISTS ] replaceable class=parametername/replaceable RESET
/varlistentry
 
varlistentry
-termliteralSET ( replaceable class=parameterview_option_name/replaceable [= replaceable class=parameterview_option_value/replaceable] [, ... ] )/literal/term
-termliteralRESET ( replaceable class=parameterview_option_name/replaceable [, ... ] )/literal/term
+termreplaceable class=parameterview_option_name/replaceable/term
+listitem
+ para
+  The name of a view option to be set or reset.
+ /para
+/listitem
+   /varlistentry
+
+   varlistentry
+termreplaceable class=parameterview_option_value/replaceable/term
 listitem
  para
-  Sets or resets a view option.  Currently supported options are:
-  variablelist
-   varlistentry
-termliteralcheck_option/literal (typestring/type)/term
-listitem
- para
-  Changes the check option of the view.  The value must
-  be literallocal/literal or literalcascaded/literal.
- /para
-/listitem
-   /varlistentry
-   varlistentry
-termliteralsecurity_barrier/literal (typeboolean/type)/term
-listitem
- para
-  Changes the security-barrier property of the view.  The value must
-  be Boolean value, such as literaltrue/literal
-  or literalfalse/literal.
- /para
-/listitem
-   /varlistentry
-  /variablelist
+  The new value for a view option.
  /para
 /listitem
/varlistentry
diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml
index eaa410b..d61a22e 100644
--- a/doc/src/sgml/ref/create_aggregate.sgml
+++ b/doc/src/sgml/ref/create_aggregate.sgml
@@ -59,13 +59,13 @@ CREATE AGGREGATE replaceable class=PARAMETERname/replaceable (
 [ , FINALFUNC = replaceable class=PARAMETERffunc/replaceable ]
 [ , FINALFUNC_EXTRA ]
 [ , INITCOND = replaceable class=PARAMETERinitial_condition/replaceable ]
-[ , MSFUNC = replaceable class=PARAMETERmsfunc/replaceable ]
-[ , MINVFUNC = replaceable class=PARAMETERminvfunc/replaceable ]
-[ , MSTYPE = replaceable class=PARAMETERmstate_data_type/replaceable ]
-[ , MSSPACE = replaceable class=PARAMETERmstate_data_size/replaceable ]
-[ , MFINALFUNC = replaceable class=PARAMETERmffunc/replaceable ]
+[ , MSFUNC = replaceable class=PARAMETERsfunc/replaceable ]
+[ , MINVFUNC = replaceable