EnterpriseDB has recently experienced a surge in demand for Postgres training, with a 26% increase in participants over the last year alone. This reflects not only the expansion of EDB’s end user base, but also the rising interest in Postgres in the industry overall. More and more large enterprise customers want to use EDB’s tools in production and non-production environments to satisfy mission critical deployments. To support Postgres users building, configuring, testing and staging new mission-critical applications, EDB has rolled out new Postgres Plus Developer Edition subscriptions. Read the rest of this entry »Tweet
PostgreSQL Open Source Database for the Enterprise
When a well-prepared DBA begins to consider their Postgres rollout, they should think about their database strategy sooner rather than later. Thinking about key database variables and questions in advance will give you the inside knowledge you need to make you the IT hero as you reveal a solid deployment plan that directly supports the goals of the business.
Part 2 of this two-part blog series addresses the second set of 5 in the top 10 list of things to consider before undertaking a Postgres rollout.
Read the first installment here.
This story is playing out all over web. You have a successful web application that you’re hosting on a system that can’t keep up with the application’s growth. You know the cloud offers flexibility and scalability that will allow your application to adapt to the growth. However, you’re concerned that moving the application will be risky and interrupt the service that your customers depend on.
It’s a common conundrum, to be sure. But there are migration strategies that will ensure you’re successful. These will be covered during a webinar, Migrating a Production Database to the Cloud, on Jan. 21 (find more info or register here). Below is a summary of some of the information we’ll cover. Read the rest of this entry »Tweet
Before you begin a Postgres deployment, it is crucial to think about your database strategy sooner rather than later. Neglecting to do so can result in misallocated resources, limited ability to change, or worse, critical data loss as a result of an outage or disaster.
By taking the time to think about some key database variables and making sure you’ve answered some key questions, you can reduce risk, spend less time troubleshooting post-production, lower long-term maintenance costs, and instill confidence by using a well-designed deployment plan. All this adds up to you being a superstar DBA.
This two-part blog series addresses the top ten questions every DBA needs to ask and answer before embarking on a Postgres rollout. The first five are addressed here in part 1. Read the rest of this entry »Tweet
First, Amit Kapila has published a draft patch for parallel sequential scan. Many things remain to be improved about this patch, which is neither as robust as it needs to be nor as performant as we'd like it to be nor as well-modularized as it really should be. But it exists, and it passes simple tests, and that is a big step forward. Even better, on most of Amit's tests, it shows a very substantial speed-up over a non-parallel sequential scan.
Read more »
In the course of my work at EnterpriseDB, migrating Oracle databases to EnterpriseDB’s Postgres Plus Advanced Server is a common task. However, now and then we encounter unique situations. While working on a migration project recently, we encountered a new use case for RLS (Row level Security).
The customer had a centralized database where it stored a huge number of transactions. These transactions are performed by different business units located in different parts of the world. There are certain types of transactions that should not be visible even if they are being queried by the same company. That is where RLS comes in. With RSL, specific transactions, or kinds of transactions, that can remain visible are mapped back to an attribute in the table.
The customer needed the application to authenticate users and set the context for which records in the database become visible for a specific session.
In its deployment of Oracle, the customer had used the functions/procedure in the Oracle package DBMS_SESSION. In the application, the customer used DBMS_SESSION.SET_CONTEXT to set the context. And for the Row Level Security, the customer was using the DBMS_SESSION.SYS_CONTEXT to implement security around the transactions.
Postgres Plus Advanced Server has a DBMS_SESSION package that is compatible with Oracle. However, it does not currently offer users the capability of setting the user defined context and implementing RLS based on those context. Given others may experience similar situations , as our customer, I wanted to provide the procedures and functions that users could deploy.
The definition of this procedure is given below:
CREATE OR REPLACE PROCEDURE set_context(namespace TEXT, attribute TEXT, val TEXT) AS BEGIN EXECUTE IMMEDIATE format('SET %s.%s TO %s',namespace, attribute,val); END;
Using this procedure, users can set their own context at session level.
The following is a function to help view the context in session, which is set using the above procedure.
CREATE OR REPLACE FUNCTION USYS_CONTEXT(namespace TEXT, parameter TEXT, len BIGINT DEFAULT 8) RETURN TEXT AS DECLARE return_val TEXT; BEGIN EXECUTE IMMEDIATE format('SHOW %s.%s',namespace,parameter) INTO return_val; RETURN substr(return_val,1,len); EXCEPTION WHEN others THEN RETURN NULL; END;
The following is an example of how we can implement row level security based on the above procedure and functions:
1. Create a table which will have attribute context_check to map the context set by procedure:
CREATE TABLE test_rls(id numeric, col text, context_check text); INSERT INTO test_rls SELECT id, 'First_check','aaa' FROM generate_series(1,10) foo(id); INSERT INTO test_rls SELECT id, 'First_check','bbb' FROM generate_series(1,10) foo(id); INSERT INTO test_rls SELECT id, 'First_check','ddd' FROM generate_series(1,10) foo(id);
2. Now create a function to check the application context. Below is one function:
CREATE OR REPLACE FUNCTION verify_user_context ( p_schema TEXT, p_object TEXT ) RETURN VARCHAR2 IS DECLARE predicate TEXT; BEGIN predicate := format('context_check = public.usys_context(''%s''::text,''%s''::text, 8)','CONTEXT','APP_PREDICATE'); RETURN predicate; END;
3. Now Apply Security Policy using Policy Functions shown below:
DECLARE v_object_schema VARCHAR2(30) := 'public'; v_object_name VARCHAR2(30) := 'test_rls'; v_policy_name VARCHAR2(30) := 'secure_data'; v_function_schema VARCHAR2(30) := 'public'; v_policy_function VARCHAR2(30) := 'verify_user_context'; v_statement_types VARCHAR2(30) := 'INSERT,UPDATE,DELETE,SELECT'; v_update_check BOOLEAN := TRUE; v_enable BOOLEAN := TRUE; BEGIN DBMS_RLS.ADD_POLICY( v_object_schema, v_object_name, v_policy_name, v_function_schema, v_policy_function, v_statement_types, v_update_check, v_enable ); END;
Now we are set to test this implementation.
Connect to one session and try the following:
1. Set the context using procedure SET_CONTEXT as given below:
EXEC SET_CONTEXT('CONTEXT','APP_PREDICATE','ddd'); EDB-SPL Procedure successfully completed
2. Verify in the same session to determine if we have set the Context properly:
SELECT USYS_CONTEXT('CONTEXT','APP_PREDICATE',2000); usys_context -------------- ddd (1 row)
3. Since in session, we have Context set as ddd, there in this session, we should be able to see rows respective to set contexts:
beta=# SELECT * FROM test_rls ; id | col | context_check ----+-------------+--------------- 1 | First_check | ddd 2 | First_check | ddd 3 | First_check | ddd 4 | First_check | ddd 5 | First_check | ddd 6 | First_check | ddd 7 | First_check | ddd 8 | First_check | ddd 9 | First_check | ddd 10 | First_check | ddd (10 rows)
As you can see, the DBMS_RLS package in Postgres Plus Advanced Service can help in implementing Row Level Security based on Application Context.
Filed under: Postgres Plus Advanced Server, PPAS, PPAS 9.3 Tagged: Advanced Server, VPD
The EDB Backup and Recovery Tool (BART) is an administrative utility providing simplified backup and recovery management for multiple local or remote Postgres Plus Advanced Server and PostgreSQL database servers. Managing backups of your important business data and the speedy recovery of your data in case of an incident is critical for any organization.
The process of taking backups and performing recovery or point-in-time recovery can be a complicated process. DBAs often feel that more than others. EDB developed BART to simplify the important operations of backup and recovery management for the users of PostgreSQL and Postgres Plus Advanced Server. Read the rest of this entry »Tweet
The adoption of Postgres within existing database infrastructures is rising, posing new questions and challenges for even veteran database professionals. At EnterpriseDB, we’re seeking to share stories from PostgreSQL users on their experiences, surprises and challenges.
Locately is a full-service shopper insights firm offering services in the US and Canada. Locately aims to replace the traditional in-person shopper intercept with a new big data solution that leverages the power of mobile, sending shoppers in-the-moment mobile surveys to understand what they do and why. Every day, the company needs to track over a million location points from participants’ phones in real time, and deliver tens of thousands of surveys. Needless to say, they need a reliable, enterprise-class database with geospatial capabilities.
The following is a conversation with Locately senior developer Josh Kupershmidt and software engineer Matt Klein about the experiences they’ve had with Postgres and why they chose Postgres to support all of their operations. Read the rest of this entry »Tweet
Below are the steps you need to compile PLV8 with Postgres Plus Advanced Server 9.3/9.4.
To get started, here are the prerequisites:
- A supported version of PostgreSQL or Postgres Plus Advanced Server, such as versions 9.1 and higher.
- 2V8 version 3.14.5
- g++ version 4.5.1
If you want to know more about V8, you can visit the following wiki page:
It’s important to note that when compiling PLV8 with Postgres Plus Advanced Server 9.3 or the upcoming 9.4, you will get the following two types of error messages: Read the rest of this entry »Tweet