Re: [BUGS] BUG #6457: Regexp not processing word (with special characters on ends) correctly (UTF-8)

2012-02-15 Thread Duncan Rance
On 14 Feb 2012, at 18:28, Tom Lane wrote:
> 
> Oh, I see the reason for this: the code in cclass() in regc_locale.c
> doesn't go further up than U+00FF, so no codes above that will be
> thought to be letters (or members of any other character class).
> Clearly we need to go further when we are dealing with UTF8.
> I'm not sure what a sane limit would be though.

The Basic Multilingual Plane goes up to :

https://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Planes

Re: [BUGS] BUG #6457: Regexp not processing word (with special characters on ends) correctly (UTF-8)

2012-02-15 Thread Duncan Rance
On 14 Feb 2012, at 18:28, Tom Lane wrote:
> 
> Oh, I see the reason for this: the code in cclass() in regc_locale.c
> doesn't go further up than U+00FF, so no codes above that will be
> thought to be letters (or members of any other character class).
> Clearly we need to go further when we are dealing with UTF8.
> I'm not sure what a sane limit would be though.


The Basic Multilingual Plane goes up to :

https://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Planes

Re: [BUGS] BUG #6452: psql: can't change client encoding from the command line

2012-02-15 Thread Félix GERZAGUET
Thanks for the workaround. I'll use it untill the bug is fixed :-)

--
Félix



On Tue, Feb 14, 2012 at 1:41 PM, Heikki Linnakangas <
heikki.linnakan...@enterprisedb.com> wrote:

> On 11.02.2012 20:02, felix.gerzag...@gmail.com wrote:
>
>> Using the command line, I can't change the client encoding, but I can
>> change
>> it using the "\encoding" command :
>>
>> C:\>psql --variable=ENCODING=UTF8
>> could not find a "psql" to execute
>> could not find a "psql" to execute
>> psql (9.1.2)
>> WARNING: Console code page (850) differs from Windows code page (1252)
>>  8-bit characters might not work correctly. See psql reference
>>  page "Notes for Windows users" for details.
>> Type "help" for help.
>>
>> postgres=# \encoding
>> WIN1252
>> postgres=# \echo :ENCODING
>> WIN1252
>> postgres=# \encoding UTF8
>> postgres=# \encoding
>> UTF8
>> postgres=# \echo :ENCODING
>> UTF8
>> postgres=# \q
>>
>
> Yeah, "\set ENCODING UTF8" doesn't seem to work either. The "ENCODING"
> psql variable tracks changes to the server's client_encoding setting, but
> not vice versa. That probably should be fixed, or at least it should throw
> an error telling the user to use \encoding instead.
>
> As a workaround, you can set the PGCLIENTENCODING environment variable
> before launching psql.
>
> --
>  Heikki Linnakangas
>  EnterpriseDB   http://www.enterprisedb.com
>


Re: [BUGS] Botched estimation in eqjoinsel_semi for cases without reliable ndistinct

2012-02-15 Thread Tom Lane
[ getting back to this after assorted distractions ]

Andres Freund  writes:
> On Thursday, January 12, 2012 02:24:44 AM Tom Lane wrote:
>> Andres Freund  writes:
>>> On Thursday, January 12, 2012 01:01:01 AM Tom Lane wrote:
 Looks pretty bogus to me.  You're essentially assuming that the side of
 the join without statistics is unique, which is a mighty dubious
 assumption.

>>> It sure is a bit dubious. But assuming that a semijoin that has max of n
>>> rows on the inner side results in half of the outer sides rows (>> n) is
>>> pretty bogus as well.

> In the current example we have an estimate for the distinctness of the LHS. I 
> don't see how guesstimating the RHS number of tuples in a semijoin to 
> vardata2->rel->rows will be worse than just assuming a selectivity of 0.5 for 
> the whole thing.

The real problem is that the estimate we want to use involves the ratio
nd2/nd1.  If either of those numbers is mere fantasy, so is the ratio.
It doesn't really help to say "well, we can upper-bound this number
here", because sometimes a too large result is as bad as too small.

>> One thing I've considered but not done anything about is that in a lot
>> of practical cases for this, the aggregation or grouping properties of
>> the sub-select would provide adequate reason for assuming its output is
>> more or less unique, so that taking ndistinct equal to number of rows
>> actually is sane.  But it would need a bit of thought about what
>> properties we want to treat as justifying such an assumption, and then
>> some code to see if the join key is a Var coming out of such a
>> sub-select.  (Actually, what such a patch would probably look like is
>> modifying examine_simple_variable to not just punt when it finds the
>> Var came from an aggregating subquery.)

> Yes, having that would be great, but be a bit more invasive than I like to 
> think right now. This thing is actually a problem for people in the field...

I'm not sure it's that bad.  Attached is a simple patch to notice that
the subquery is "SELECT DISTINCT foo" and if so assume the result is
unique.  This takes care of at least the first of your original
examples.  I'm not sure whether fixing this single case is enough to get
excited about, but it's a step forward anyway.

Your second example, involving a WITH, would properly be handled by
teaching examine_simple_variable to drill down into CTEs.  I lacked the
round tuits to make it do so initially, and still do, but if you'd like
to have a go at it ...

regards, tom lane

diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 6d78068476e520f7dd2da6c0c8d48d93e0649768..5a4fa77848b5e44abd913e536f0f83cc06bb85fb 100644
*** a/src/backend/utils/adt/selfuncs.c
--- b/src/backend/utils/adt/selfuncs.c
***
*** 110,115 
--- 110,116 
  #include "optimizer/predtest.h"
  #include "optimizer/restrictinfo.h"
  #include "optimizer/var.h"
+ #include "parser/parse_clause.h"
  #include "parser/parse_coerce.h"
  #include "parser/parsetree.h"
  #include "utils/builtins.h"
*** examine_simple_variable(PlannerInfo *roo
*** 4357,4375 
  	{
  		/*
  		 * Plain subquery (not one that was converted to an appendrel).
- 		 *
- 		 * Punt if subquery uses set operations, GROUP BY, or DISTINCT --- any
- 		 * of these will mash underlying columns' stats beyond recognition.
- 		 * (Set ops are particularly nasty; if we forged ahead, we would
- 		 * return stats relevant to only the leftmost subselect...)
  		 */
  		Query	   *subquery = rte->subquery;
  		RelOptInfo *rel;
  		TargetEntry *ste;
  
  		if (subquery->setOperations ||
! 			subquery->groupClause ||
! 			subquery->distinctClause)
  			return;
  
  		/*
--- 4358,4378 
  	{
  		/*
  		 * Plain subquery (not one that was converted to an appendrel).
  		 */
  		Query	   *subquery = rte->subquery;
  		RelOptInfo *rel;
  		TargetEntry *ste;
  
+ 		/*
+ 		 * Punt if subquery uses set operations or GROUP BY, as these will
+ 		 * mash underlying columns' stats beyond recognition.  (Set ops are
+ 		 * particularly nasty; if we forged ahead, we would return stats
+ 		 * relevant to only the leftmost subselect...)  DISTINCT is also
+ 		 * problematic, but we check that later because there is a possibility
+ 		 * of learning something even with it.
+ 		 */
  		if (subquery->setOperations ||
! 			subquery->groupClause)
  			return;
  
  		/*
*** examine_simple_variable(PlannerInfo *roo
*** 4415,4420 
--- 4418,4437 
   rte->eref->aliasname, var->varattno);
  		var = (Var *) ste->expr;
  
+ 		/*
+ 		 * If subquery uses DISTINCT, we can't make use of any stats for the
+ 		 * variable ... but, if it's the only DISTINCT column, we are entitled
+ 		 * to consider it unique.  We do the test this way so that it works
+ 		 * for cases involving DISTINCT ON.
+ 		 */
+ 		if (subquery->distinctClause)
+ 		{
+ 			if (list_length(subquery->distinctClause) == 1 &&
+ tar

[BUGS] probleme d'installation

2012-02-15 Thread yannick godbout

Bonjours,

j'ai un probleme avec l’installation de postgresql. Lorsque je viens pour 
installer le programme il me demande un password et je ne connais pas le 
password et je ne sais pas comment l'obtenir. je vous fait parvenir un sprint 
screen que j'ai fait du programme et que j'ai mis sur le document word que j'ai 
mis sur le ce e-mail.


merci
Yannick

 
yannick a un fichier à partager avec vous sur SkyDrive. Pour le consulter, 
cliquez sur le lien ci-dessous.postgresql.docx