Categories
Database Development

Can I use Postgres rules to reset session variables before/after queries?

I am using Postgres row based security and I wish to ensure it is not possible for a specific session variable (that holds a tenant id) to remain set in between transactions / queries. The reason is because the session is shared between user queries – if that session variable is set but not cleared, […]

Categories
Database Development

Can I use Postgres rules to reset session variables before/after queries?

I am using Postgres row based security and I wish to ensure it is not possible for a specific session variable (that holds a tenant id) to remain set in between transactions / queries. The reason is because the session is shared between user queries – if that session variable is set but not cleared, […]

Categories
Database Development

Can I use Postgres rules to reset session variables before/after queries?

I am using Postgres row based security and I wish to ensure it is not possible for a specific session variable to remain set in between transactions / queries. The reason is because the session is shared between user queries. I wish to ensure that the only session variables that can be used are LOCAL […]

Categories
Database Development

MySQL InnoDB cluster admin unable to create database

I have set up a new InnoDB cluster and created a non-root admin user. I have also set up mysqlrouter on a seperate host. To open a session I am using mysqlsh on the current primary member using the non-root admin user: [root@srv-db-mysql-03 ~]# mysql –version mysql Ver 8.0.23 for Linux on x86_64 (MySQL Community […]

Categories
Database Development

MySQL InnoDB cluster admin unable to create database

I have set up a new InnoDB cluster and created a non-root admin user. I have also set up mysqlrouter on a seperate host. To open a session I am using mysqlsh on the current primary member using the non-root admin user: [root@srv-db-mysql-03 ~]# mysql –version mysql Ver 8.0.23 for Linux on x86_64 (MySQL Community […]

Categories
Database Development

MySQL InnoDB cluster admin unable to create database

I have set up a new InnoDB cluster and created a non-root admin user. I have also set up mysqlrouter on a seperate host. To open a session I am using mysqlsh on the current primary member using the non-root admin user: [root@srv-db-mysql-03 ~]# mysql –version mysql Ver 8.0.23 for Linux on x86_64 (MySQL Community […]

Categories
Mastering Development

User roles and permissions. Laravel Fortify (and not only)

Is there any ready-made functionality in the Fortify package for setting user roles and permissions (regular user, admin, main admin, etc.)? If not, what is the correct way to implement it yourself? Alternatively, create middleware and an is_admin field in the users table. And do the check: if(Auth::user()->is_admin != 1){ return redirect()->route(‘index’); } Route: Route::group([‘middleware’ […]

Categories
Database Development

2ndQuadrant/Pglogical multi-master cluster installation

I’m looking for a way to make a multi-master cluster with pglogical. When I say multi-master, it’s means 3 nodes, where each of them is a provider and a subscriber. Currently I have two nodes that working fine as a provider and a subscriber at the same time. But when I whant to add my […]

Categories
Mastering Development

DatabaseError when Login Out of Application

I’m working on a project that consist on sensor data and realtime database data into the application. My App receives the data from the sensor every time it is updated, using a StreamBuilder. Everything is working fine, I can get, update, add and remove data from my database, I can login and register succesfully. But […]

Categories
Database Development

Transaction Time Tables in MSSQL and Constraints

I am trying to implement transaction time tables on a MSSQL Server 2016 following the book by Richard Snodgrass (Developing Time-Oriented Database Applications in SQL). A table with a sequenced primary key through a trigger could be implemented like this: CREATE TABLE test_table ( a [tinyint] NOT NULL, b [date] NOT NULL, c [float] NOT […]