90 likes | 242 Views
PostgreSQL plugin for SSB. Robert Vežnaver IT/SDC 25 th April 2014. architecture. siteview. Oracle Context. cx_Oracle. ideal solution. siteview. PostgreSQL Context. psycopg2. Oracle SQL. psycopg2. “false friends”. DECODE NVL ROWNUM SET TIME_ZONE SYS_EXTRACT_* SYSDATE.
E N D
PostgreSQL plugin for SSB Robert Vežnaver IT/SDC 25th April 2014
architecture • siteview • Oracle Context • cx_Oracle PostgreSQL plugin for SSB
ideal solution • siteview • PostgreSQL Context • psycopg2 PostgreSQL plugin for SSB
Oracle SQL • psycopg2 “false friends” DECODE NVL ROWNUM SET TIME_ZONE SYS_EXTRACT_* SYSDATE translator Oracle SQL variable binding :var %(var)s PostgreSQL plugin for SSB
PL/SQL procedures • psycopg2 translator PL/pgSQL Oracle SQL PL/SQL callproc() PostgreSQL plugin for SSB
Bypassing context • psycopg2 translator PL/pgSQL cursor() Oracle SQL PL/SQL callproc() PostgreSQL plugin for SSB
Code consistency • psycopg2 • http/siteview translator PL/pgSQL cursor() Oracle SQL PL/SQL callproc() PostgreSQL plugin for SSB
Case sensitivity Oracle returns UPPERCASE,PgSQL returns lowercase Most columns in Oracle are CamelCase, but not all! Reserved SQL words used as names! Other modules get key/value list directly, therefore JavaScript code depends on case! Monitoring of Grid Operations - S. Roiser
Proposed solution • Create style guidelines document • Rewrite SQL to ANSI • Remove PL/SQL procedures • Case sensitivity • use PostgreSQL with “CamelCase”, modify cursor for uppercase • make everything go through context mapper Monitoring of Grid Operations - S. Roiser