Re: WIP: multivariate statistics / proof of concept
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tomas Vondra <tv@fuzzy.cz>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2014-10-30T09:23:38Z
Lists: pgsql-hackers
On Thu, Oct 30, 2014 at 12:21 AM, Tomas Vondra <tv@fuzzy.cz> wrote: > Dne 29 Říjen 2014, 10:41, David Rowley napsal(a): > > I'm quite interested in reviewing your work on this, but it appears that > > some of your changes are not C89: > > > > src\backend\commands\analyze.c(3774): error C2057: expected constant > > expression [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(3774): error C2466: cannot allocate an > > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(3774): error C2133: 'indexes' : unknown > > size [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4302): error C2057: expected constant > > expression [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4302): error C2466: cannot allocate an > > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4302): error C2133: 'ndistincts' : > unknown > > size [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4775): error C2057: expected constant > > expression [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4775): error C2466: cannot allocate an > > array of constant size 0 [D:\Postgres\a\postgres.vcxproj] > > src\backend\commands\analyze.c(4775): error C2133: 'keys' : unknown size > > [D:\Postgres\a\postgres.vcxproj] > > > > I'll look into that. The thing is I don't have access to MSVC, so it's a > bit > difficult to spot / fix those issues :-( > > It should be a pretty simple fix, just use the files and line numbers from the above. It's just a problem that in those 3 places you're declaring an array of a variable size, which is not allowed in C89. The thing to do instead would just be to palloc() the size you need and the pfree() it when you're done. Regards David Rowley
Commits
-
Collect and use multi-column dependency stats
- 2686ee1b7ccf 10.0 landed
-
Implement SortSupport for macaddr data type
- f90d23d0c518 10.0 cited
-
Implement multivariate n-distinct coefficients
- 7b504eb282ca 10.0 landed
-
Generate fmgr prototypes automatically
- 352a24a1f9d6 10.0 cited