babelfish-for-postgresql / babelfish_extensions

Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
https://babelfishpg.org/
Apache License 2.0
277 stars 93 forks source link

[Enhancement]: When will ALTER DATABASE statements be supported? #109

Open williamgosse opened 2 years ago

williamgosse commented 2 years ago

Contact Details

No response

What's the question?

I have a question! When will ALTER DATABASE statements be supported? Is there any work around?

Msg 33557097, Level 16, State 1, Line 1 'ALTER DATABASE' is not currently supported in Babelfish

Completion time: 2022-03-29T17:54:25.8311871+00:00

Relevant log output or information

No response

Code of Conduct

robverschoor commented 2 years ago

Which ALTER DATABASE options would you need? Many of these are very SQL Server specific and will not be relevant in a PG context.

williamgosse commented 2 years ago

Yes this is true. It's mostly setting properties that are probably SQL Server specific: USE [master];

CREATE DATABASE PRISMG2;

EXEC sp_dbcmptlevel @dbname=N'PRISMG2', @new_cmptlevel=100;

ALTER DATABASE PRISMG2 SET ANSI_NULL_DEFAULT OFF;

ALTER DATABASE PRISMG2 SET ANSI_NULLS OFF;

ALTER DATABASE PRISMG2 SET ANSI_PADDING OFF;

ALTER DATABASE PRISMG2 SET ANSI_WARNINGS OFF;

ALTER DATABASE PRISMG2 SET ARITHABORT OFF;

ALTER DATABASE PRISMG2 SET AUTO_CLOSE OFF;

ALTER DATABASE PRISMG2 SET AUTO_CREATE_STATISTICS ON;

ALTER DATABASE PRISMG2 SET AUTO_SHRINK OFF;

ALTER DATABASE PRISMG2 SET AUTO_UPDATE_STATISTICS ON;

ALTER DATABASE PRISMG2 SET CURSOR_CLOSE_ON_COMMIT OFF;

ALTER DATABASE PRISMG2 SET CURSOR_DEFAULT GLOBAL;

ALTER DATABASE PRISMG2 SET CONCAT_NULL_YIELDS_NULL OFF;

ALTER DATABASE PRISMG2 SET NUMERIC_ROUNDABORT OFF;

ALTER DATABASE PRISMG2 SET QUOTED_IDENTIFIER OFF;

ALTER DATABASE PRISMG2 SET RECURSIVE_TRIGGERS OFF;

ALTER DATABASE PRISMG2 SET DISABLE_BROKER;

ALTER DATABASE PRISMG2 SET AUTO_UPDATE_STATISTICS_ASYNC OFF;

ALTER DATABASE PRISMG2 SET DATE_CORRELATION_OPTIMIZATION OFF;

ALTER DATABASE PRISMG2 SET TRUSTWORTHY OFF;

ALTER DATABASE PRISMG2 SET ALLOW_SNAPSHOT_ISOLATION OFF;

ALTER DATABASE PRISMG2 SET PARAMETERIZATION SIMPLE;

ALTER DATABASE PRISMG2 SET READ_WRITE;

ALTER DATABASE PRISMG2 SET RECOVERY FULL;

ALTER DATABASE PRISMG2 SET MULTI_USER;

ALTER DATABASE PRISMG2 SET PAGE_VERIFY CHECKSUM;

ALTER DATABASE PRISMG2 SET DB_CHAINING OFF;