zombodb with postgres-xl: "zombodb.so: undefined symbol: session_auth_is_superuser" - postgresql

I have a database cluster based on Postgres-xl 10. I have to create a search index by ZomboDB extension. I copied all extension files into /usr/local/pgsql/lib other than standard path of postgresql /usr/lib/pgsql/lib. Because I checked that postgres-xl uses different $libdir from postgresql.
When CREATE EXTENSION zombodb;, it gives error:
ERROR: could not load library "/usr/local/pgsql/lib/zombodb.so": /usr/local/pgsql/lib/zombodb.so: undefined symbol: session_auth_is_superuser
SQL state: XX000
How can I overcome this problem?

You can't use plugins or extensions for standard Postgres index's on Postgres-XL.
Posgres-XL is a distributed database. i.e. It is meant to have the data broken up over different nodes which means it's index's work in a completely different mannor with different settings requirements, and have to work across the coordinator nodes and the global transaction managers.
Unless this vender provides specific libs for Postgres-XL it is not going to work. Even if you could find a way to trick it into working it would be a REALLY bad idea. It could fail at any time because that software has never been tested to work like that.

Related

How to add changes for NO ENCRYPT DB2 option to db2RestoreStruct

I am trying to restore encrypted DB to non-encryped DB. I made changes by setting piDbEncOpts to SQL_ENCRYPT_DB_NO but still restore is being failed. Is there db2 sample code is there where I can check how to set "NO Encrypt" option in DB2. I am adding with below code snippet.
db2RestoreStruct->piDbEncOpts->encryptDb = SQL_ENCRYPT_DB_NO
The 'C' API named db2Restore will restore an encrypted-image to a unencrypted database , when used correctly.
You can use a modified version of IBM's samples files: dbrestore.sqc and related files, to see how to do it.
Depending on your 'C' compiler version and settings you might get a lot of warnings from IBM's code, because IBM does not appear to maintain the code of their samples as the years pass. However, you do not need to run IBM's sample code, you can study it to understand how to fix your own C code.
If installed, the samples component must match your Db2-server version+fixpack , and you must use the C include files that come with your Db2-server version+fixpack to get the relevant definitions.
The modifications to IBM's samples code include:
When using the db2Restore API ensure its first argument has a value that is compatible with your server Db2-version-and-fixpack to access the required functionality. If you specify the wrong version number for the first argument, for example a version of Db2 that did not support this functionality, then the API will fail. For example, on my Db2-LUW v11.1.4.6, I used the predefined db2Version1113 , like this:
db2Restore(db2Version1113, &restoreStruct, &sqlca);
When setting the restore iOptions field: enable the flag DB2RESTORE_NOENCRYPT, for example, in IBM's example, include the additional flag: restoreStruct.iOptions = DB2RESTORE_OFFLINE | DB2RESTORE_DB | DB2RESTORE_NODATALINK | DB2RESTORE_NOROLLFWD | DB2RESTORE_NOENCRYPT;
Ensure the restoredDbAlias differs from the encrypted-backup alias name.
I tested with Db2 v11.1.4.6 (db2Version1113 in the API) with gcc 9.3.
I also tested with Db2 v11.5 (db2Version11500 in the API) with gcc 9.3.

Prisma 2 with different databases

I'm new at prisma 2 but have got a database working. I have used prisma 'init' and 'migrate dev' to create database tables for my model and can interact with the database using the Prisma client - prisma 2.22.1
Usually for a project, I'd have dev, test and prod environments and use env-cmd to set the relevant differences, e.g. connection details for getting to the database.
With prisma 2 however, it seems like there's a single .env file that is used for the database connection details, so I cannot see how to proceed for the different environments.
Note that I'm not meaning different types of database - in this example all are postgresql.
I can see possibilities for getting past this hurdle, for example for the script to write a suitable .env file according to the required environment as part of running the app, but 'not ideal' really doesn't give this idea the review that it deserves. Or getting more computers.
Any suggestions please for using different databases from the same project? Am I missing something basic or is it deliberately blocked?

Internal Server Error (500) AWS Elasticbeanstalk deployed flask app

I have deployed various versions of the app previously with no errors.
However, I had to make some modifications on two tables in my AWS RDS running PostgreSQL. alter table NAME alter column NAME type date using to_date(...)
I've done that directly on the AWS RDS and modified SQLAlchemy column accordingly. date = Column(Date)
Any API call that sends queries these two tables returns Internal Server Error - In the meantime, there are no errors in deploying this version of the app and moreover from my python interpreter running any SQLAlchemy code that queries any of these two tables always returns what's expected.
I have tried several ways to fix this. The only one that worked is to remove the line date = Column(Date) from SQLAlchemy setup file - Then there was no 500 on any API call but of course that doesn't help as I need that column!
Any help on this will be highly appreciated really...

Security vulnerabilities with quoting in SQL

i am doing a simple select using the zend\db\sql classes and i got the following error.
Notice: Attempting to quote a value in Zend\Db\Adapter\Platform\Mysql
without extension/driver support can introduce security
vulnerabilities in a production environment. in
C:\wamp\vendor\zendframework\zend-db\Zend\Db\Adapter\Platform\Mysql.php
on line 134
Below is my code that output the errors.
$select2 = $this->sql->select()
->from('users')
->where(array("fbid = ?" => $id));
$selectSqlString = $this->sql->getSqlStringForSqlObject($select2);
$this->dbo->query($selectSqlString, Adapter::QUERY_MODE_EXECUTE);
May i know why does this happens and what should i do to prevent it?
Cheers~
By looking at the code for the MySQL class (I know that the provided link is for ZF2, but it looks like the same code is used), it would seem, that you are missing both the PDO and mysqli extension. That would mean that you are currently using mysql extension to connect to MySQL db, which is deprecated.
As a solution, I would recommend installing mysqli.

How do I use Puppet's ralsh with resource types provided by modules?

I have installed the postgresql module from Puppetforge.
How can I query Postgresql resources using ralsh ?
None of the following works:
# ralsh postgresql::db
# ralsh puppetlabs/postgresql::db
# ralsh puppetlabs-postgresql::db
I was hoping to use this to get a list of databases (including attributes such as character sets) and user names/passwords from the current system in a form that I can paste into a puppet manifest to recreate that setup on a different machine.
In principle, any puppet client gets the current state of your system from another program called Facter. You should create a custom Fact (a module of Facter), and then included into your puppet client. Afterwards, I think you could call this custom Fact from ralsh.
More information about creating a custom Fact can be found in here.
In creating your own Fact, you should execute your SQL query and then save the result into particular variable.