[BUGS] BUG #8199: row datatypes are not hashable

2013-06-03 Thread divided . mind
The following bug has been logged on the website:

Bug reference:  8199
Logged by:  Rafal Rzepecki
Email address:  divided.m...@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Ubuntu 13.04
Description:

Row datatypes are currently not hashable, which makes it slower to use them
in a UNIQUEd query and impossible to use them in a recursive query (unless
using UNION ALL):

divide=# create type the_row as (mfg text, id text);
CREATE TYPE
divide=# with recursive rec(w, i) as (  
   
select '(pow,xyzzy)'::the_row, 3
union
select w, i-1 from rec where i > 0
) select * from rec;
ERROR:  could not implement recursive UNION
DETAIL:  All column datatypes must be hashable.




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


Re: [BUGS] BUG #8193: A few cosmetic misspell fixes.

2013-06-03 Thread Veres Lajos
On Sat, 1 Jun 2013, Michael Paquier wrote:

> Referring a patch with an external link is bad practice as the external
> service you use could disappear, making this patch lost at the same time.
> Please attach patches directly with the mails you send.
>
> For the patch, yes OK there are some spell mistakes. However this patch
> should only apply on master branch, and not 9.2 as referenced above. Also,
> changing the structure name to Extension does not look to be appropriate as
> it is a generic name...

I used this form:
http://www.postgresql.org/support/submitbug/
I didnt see any option for uploading patch or choosing trunk.

Anyway sorry for the inconveniences.

-- 
Veres Lajos
vla...@gmail.com
+36 20 438 5909diff --git a/contrib/pg_upgrade/relfilenode.c b/contrib/pg_upgrade/relfilenode.c
index 53e0700..10c0531 100644
--- a/contrib/pg_upgrade/relfilenode.c
+++ b/contrib/pg_upgrade/relfilenode.c
@@ -247,7 +247,7 @@ transfer_relfile(pageCnvCtx *pageConverter, FileNameMap *map,
 if (errno == ENOENT)
 	return;
 else
-	pg_log(PG_FATAL, "error while checking for file existance \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
+	pg_log(PG_FATAL, "error while checking for file existence \"%s.%s\" (\"%s\" to \"%s\"): %s\n",
 		   map->nspname, map->relname, old_file, new_file,
 		   getErrorText(errno));
 			}
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index fc6ff80..6c971f3 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -903,7 +903,7 @@ ValidXLogPageHeader(XLogReaderState *state, XLogRecPtr recptr,
 /*
  * Find the first record with at an lsn >= RecPtr.
  *
- * Useful for checking wether RecPtr is a valid xlog address for reading and to
+ * Useful for checking whether RecPtr is a valid xlog address for reading and to
  * find the first valid address after some address when dumping records for
  * debugging purposes.
  */
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c
index eb90f1b..1d59396 100644
--- a/src/backend/utils/adt/tsrank.c
+++ b/src/backend/utils/adt/tsrank.c
@@ -530,11 +530,11 @@ typedef struct
 	int			q;
 	DocRepresentation *begin;
 	DocRepresentation *end;
-} Extention;
+} Extension;
 
 
 static bool
-Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, Extention *ext)
+Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, Extension *ext)
 {
 	DocRepresentation *ptr;
 	int			lastpos = ext->pos;
@@ -729,7 +729,7 @@ calc_rank_cd(float4 *arrdata, TSVector txt, TSQuery query, int method)
 	int			len,
 i,
 doclen = 0;
-	Extention	ext;
+	Extension	ext;
 	double		Wdoc = 0.0;
 	double		invws[lengthof(weights)];
 	double		SumDist = 0.0,
@@ -759,7 +759,7 @@ calc_rank_cd(float4 *arrdata, TSVector txt, TSQuery query, int method)
 		return 0.0;
 	}
 
-	MemSet(&ext, 0, sizeof(Extention));
+	MemSet(&ext, 0, sizeof(Extension));
 	while (Cover(doc, doclen, &qr, &ext))
 	{
 		double		Cpos = 0.0;
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index b68a649..94b0117 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -487,7 +487,7 @@ ExtensionBehavior
 ExtensionControlFile
 ExtensionInfo
 ExtensionVersionInfo
-Extention
+Extension
 FDWCollateState
 FD_SET
 FILE

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


[BUGS] BUG #8198: ROW() literals not supported in an IN clause

2013-06-03 Thread divided . mind
The following bug has been logged on the website:

Bug reference:  8198
Logged by:  Rafal Rzepecki
Email address:  divided.m...@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Ubuntu 13.04
Description:

Row type literals constructed with ROW() cause an error when used in an IN
clause (string literals casted appropriately are allowed). This is
especially problematic since many client libraries use these literals to
pass values of row-type arguments, hence making it impossible to use them in
IN-clause queries.

To wit:
divide=# create type the_row as (mfg text, id text);
CREATE TYPE
divide=# create table the_table (widget the_row);   

  
CREATE TABLE


divide=# insert into the_table values(row('foo', 'bar')::the_row);  


INSERT 0 1  


divide=# insert into the_table values('(bar,baz)'::the_row);

 
INSERT 0 1
divide=# select * from the_table;
  widget   
---
 (foo,bar)
 (bar,baz)
(2 rows)

divide=# select * from the_table where widget in ('(foo,bar)'::the_row);
  widget   
---
 (foo,bar)
(1 row)

divide=# select * from the_table where widget in
(row('foo','bar')::the_row);
ERROR:  arguments of row IN must all be row expressions
LINE 1: select * from the_table where widget in (row('foo','bar')::t...
 ^




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