Comments (2)
Here is the code in question:
if (types != null) {
select += " AND (false ";
for (int i = 0; i < types.length; i++)
{
Map clauses = (Map)tableTypeClauses.get(types[i]);
if (clauses != null)
{
String clause = (String)clauses.get(useSchemas);
select += " OR ( " + clause + " ) ";
}
}
select += ") ";
}
Mondrian must not be asking for MATERIALIZED_VIEW
It does appear to be asking for TEMPORARY_TABLE and TEMPORARY_INDEX though
Dave Cramer
On 4 July 2014 05:15, ratio1 [email protected] wrote:
I am running a Mondrian OLAP Server in combination with PostgreSQL 9.3,
using postgresql-9.3-1101.jdbc4.jar. Mondrian cannot retrieve informations
about existing MATIERLIAZED VIEWs. It seems to be pgjdbc is not working
correctly. I checked my PostgreSQL logs and found following query, assuming
that this statement is part of pgjdbc:SELECT
NULL AS TABLE_CAT,
n.nspname AS TABLE_SCHEM,
c.relname AS TABLE_NAME,
CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'
WHEN true THEN
CASE
WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN
CASE c.relkind
WHEN 'r' THEN 'SYSTEM TABLE'
WHEN 'v' THEN 'SYSTEM VIEW'
WHEN 'i' THEN 'SYSTEM INDEX'
ELSE NULL
END
WHEN n.nspname = 'pg_toast' THEN
CASE c.relkind
WHEN 'r' THEN 'SYSTEM TOAST TABLE'
WHEN 'i' THEN 'SYSTEM TOAST INDEX'
ELSE NULL
END
ELSE
CASE c.relkind
WHEN 'r' THEN 'TEMPORARY TABLE'
WHEN 'i' THEN 'TEMPORARY INDEX'
WHEN 'S' THEN 'TEMPORARY SEQUENCE'
WHEN 'v' THEN 'TEMPORARY VIEW'
ELSE NULL
END
END
WHEN false THEN
CASE c.relkind
WHEN 'r' THEN 'TABLE'
WHEN 'i' THEN 'INDEX'
WHEN 'S' THEN 'SEQUENCE'
WHEN 'v' THEN 'VIEW'
WHEN 'c' THEN 'TYPE'
WHEN 'f' THEN 'FOREIGN TABLE'
WHEN 'm' THEN 'MATERIALIZED VIEW'
ELSE NULL
END
ELSE NULL
END
AS TABLE_TYPE,
d.description AS REMARKS
FROM
pg_catalog.pg_namespace n, pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0)
LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')
LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')
WHERE
c.relnamespace = n.oid
AND c.relname LIKE '%'
AND
(
false
OR ( c.relkind = 'r' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema' )
OR ( c.relkind = 'v' AND n.nspname <> 'pg_catalog' AND n.nspname <> 'information_schema' )
)
ORDER BY
TABLE_TYPE,
TABLE_SCHEM,
TABLE_NAMEThe causing problem is the last WHERE condition, limiting the result set
to tables and (regular) views only. Here is the correct Statement,
including materialized views into the result set:SELECT
NULL AS TABLE_CAT,
n.nspname AS TABLE_SCHEM,
c.relname AS TABLE_NAME,
CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'
WHEN true THEN
CASE
WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN
CASE c.relkind
WHEN 'r' THEN 'SYSTEM TABLE'
WHEN 'v' THEN 'SYSTEM VIEW'
WHEN 'i' THEN 'SYSTEM INDEX'
ELSE NULL
END
WHEN n.nspname = 'pg_toast' THEN
CASE c.relkind
WHEN 'r' THEN 'SYSTEM TOAST TABLE'
WHEN 'i' THEN 'SYSTEM TOAST INDEX'
ELSE NULL
END
ELSE
CASE c.relkind
WHEN 'r' THEN 'TEMPORARY TABLE'
WHEN 'i' THEN 'TEMPORARY INDEX'
WHEN 'S' THEN 'TEMPORARY SEQUENCE'
WHEN 'v' THEN 'TEMPORARY VIEW'
ELSE NULL
END
END
WHEN false THEN
CASE c.relkind
WHEN 'r' THEN 'TABLE'
WHEN 'i' THEN 'INDEX'
WHEN 'S' THEN 'SEQUENCE'
WHEN 'v' THEN 'VIEW'
WHEN 'c' THEN 'TYPE'
WHEN 'f' THEN 'FOREIGN TABLE'
WHEN 'm' THEN 'MATERIALIZED VIEW'
ELSE NULL
END
ELSE NULL
END
AS TABLE_TYPE,
d.description AS REMARKS,
c.relkind
FROM
pg_catalog.pg_namespace n, pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0)
LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')
LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')
WHERE
c.relnamespace = n.oid
AND c.relname LIKE '%'
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
AND c.relkind IN ('r', 'v', 'm', 'f')
ORDER BY
TABLE_TYPE,
TABLE_SCHEM,
TABLE_NAMESince I'm not familiar to git, could you please bring the code to
master/branches/patches? Or am I wrong and this code is produced by
Mondrian?Thank you for your great work.
—
Reply to this email directly or view it on GitHub
#166.
from pgjdbc.
Hi Dave,
thank you for your reply. So the problem is at the mondrian side.
Closing issue.
from pgjdbc.
Related Issues (20)
- "ERROR: SET TRANSACTION ISOLATION LEVEL must not be called in a subtransaction" with autosave HOT 2
- SSLSocket duplex close failed (again) HOT 5
- Trying to update table using PreparadStatement, But parameters are generated inside a Parentheses HOT 1
- INSERT Java Boolean Type into a database BIT type will result in an incompatible type error. HOT 5
- Authentication SSL Mechanism HOT 20
- Query interceptors HOT 4
- Authentication failed SSL error HOT 1
- Memory Consumption, binary transfer bug HOT 5
- "Unexpected packet type during copy" when network is pool HOT 2
- Connect Java with PostgreSQL (16.3) using SSPI authentication HOT 3
- Inconsistent SQL execution with "unsupported format code" error in PostgreSQL HOT 8
- Request for new release 42.7.4 HOT 1
- SSL connection is not established HOT 22
- BlobInputStream#mark/reset caches position within a large object, however it should buffer the data instead HOT 3
- JDBC Driver Ignoring Fetch Size: Full SELECT Result Loaded into RAM, Causing Heap Overflow HOT 1
- EOFException on PreparedStatement#toString with unset bytea parameter since 42.7.4 HOT 16
- Add autoCommit setting to the JDBC driver properties and/or URL
- Feature Request - Provision to plugin a custom host chooser in the pgjdbc driver HOT 6
- CTE query: java.lang.OutOfMemoryError: Java heap space, java.lang.OutOfMemoryError: GC overhead limit exceeded HOT 5
- Incorrect client side network protocol in `prepareThreshold` that leads to internal exceptions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgjdbc.