All Questions
96,363
questions
0
votes
1
answer
27
views
How to replicate between On-Premises and Azure in Mongodb
I have three 3 node cluster on-premises ( 1 Primary and 2 Secondary ). I have same 3 node cluster in AZURE ( 1 Primary and 2 Secondary ) with same version and data but with different FQDN in azure. ...
0
votes
0
answers
35
views
Can I use a LEFT JOIN on a grouped result?
I have the following two queries, which on their own work as expected:
(SELECT
max(ID_box_connections) AS bc1_ID_box_connections,
ID_boxes_from
FROM box_connections
GROUP BY ID_boxes_from)
...
1
vote
0
answers
25
views
backup a single user , password and privileges from postgresql
I am moving a database user form one postgresql server . I need to take backup of the user name , password and privileges and restore into another pgsql server. I looked into the documentation and ...
0
votes
0
answers
32
views
MySQL Workbench Migration and PostgreSQL ODBC, cannot connect
I am trying to migrate a PostgreSQL database to MySQL using the MySQL Workbench's Migration Wizard tool.
I am on Debian 11 bullseye and installed MySQL Workbench 8.0.25 using Snap.
It works fine, ...
2
votes
1
answer
79
views
Constraint for 2 foreign keys to have same secondary column value
Suppose I have a table such as Users that has a id and a company_id
I want to make a 2nd table that has pairs of user id's ex: (primary_key_id, user1_id, user2_id).
The user id's must be in the same ...
1
vote
1
answer
28
views
SSL Encryption for Kafka Pipelines
Any [SingleStore] users out there?
For enabling SSL encryption (only) for Kafka pipelines, we created the pipeline like below:
CREATE PIPELINE `kafka_ssl`
AS LOAD DATA KAFKA '<kafka-host>:<...
-3
votes
0
answers
35
views
SQL Transaction log file 900+ GB Microsoft sql server manager [duplicate]
I have software installed on our server's secondary drive with capacity 1.04TB.
Unfortunately
the sql log file has consumed almost 900GB and I tried many option to shrink it, but every time it ...
0
votes
0
answers
22
views
docker mariadb ignores to read my.cnf files from mounted volume
This problem is annoying me very much, it might be something stupidly simple to a good system admin but i've wasted many hours without success, i've tried many answer from SO and other websites and ...
2
votes
1
answer
41
views
Multiple inner JOIN on the same table [closed]
I have this table 'individu'
and this table
I want to do a select and get in the query, the 'nom' and 'prenom' for iid1 and iid2.
For the moment my query is
SELECT * FROM lien
inner join individu ...
1
vote
1
answer
108
views
Find and show special character codes from nvarchar column
I want to know which special characters (line breaks, tabs, etc) are in my column of type nvarchar.
I know how I can select which rows contain a specific character.
e.g. SELECT * FROM your_table WHERE ...
0
votes
0
answers
12
views
MS ACCESS 2k3 Flatten out a number of like records
Sorry never seem to understand how to do this kind of query in SQL
Given the following data, I am looking to make one or more Queries compatible with MS ACCESS 2k3 that will provide the following ...
1
vote
1
answer
44
views
Is it safe to use user defined variables inside stored procedures in MySQL?
Currently I'm working with Stored Procedures in MySQL and I'm using in some procedures user-defined variables and I've seen that type of variables are initialized in the current session and keep their ...
-4
votes
1
answer
36
views
List each depot name and the total salary for bus drivers working at the depot. USING SQL [closed]
Sorry, but im not sure how to properly format on here but i have 2 tables
where i have to answer the question in the title. I have no idea how too but it's homework. I keep seeing things on joins but ...
0
votes
0
answers
35
views
Order by string with numbers
I need to order the query using a pattern that mixes text and numbers. This is the default ORDER BY which is "correct" if not considering the entire numbers. But as you can see, at the end ...
1
vote
2
answers
76
views
MySQL What charset/collation for Case insensitivity and Accent sensitivity?
I am looking for a charset/collation that would make it so when I do a
SELECT * FROM table_name WHERE username = "Warrior"
It only returns me the rows where username = "Warrior", ...
0
votes
0
answers
31
views
Recover Mysql Database from idb files
After a server crash, I lost all of my mysql databases. I had backups for most of them but I'm missing an important one. the ibdata1 seems corrupted, so I had to rename the /var/lib/mysql directory ...
2
votes
0
answers
56
views
Service Broker performance issues after upgrading from 2012 to 2017 - tons of LCK_M_IX
Last night we upgraded a SQL Server 2012 server to SQL Server 2017 + CU 29. This is one of a matched set - we send the same message to both and each processes it. No, this is not AlwaysOn; we're ...
0
votes
1
answer
24
views
Best approach for basic PHP DB session data storage
I've decided to switch from PHP's native session management based on $_SESSION to use my own, due to many different issues I've had so far with PHP's possibilities, and also because I'm building an ...
0
votes
0
answers
17
views
Is there maximum limit of 2gb on work_mem in windows
I wanted to set work_mem as 8 gb for one of the session locally.
Someone said you get error(outside valid range) in windows platform for value higher than 2gb.
Is that true!? Is yes, does that apply ...
1
vote
1
answer
44
views
Looking for an alternative to a CTE that will work as a subquery in IF EXISTS
I have an IF EXISTS 'upsert' running fine by itself in it’s own stored proc. But when I try and use the same statement referencing a CTE, it doesn't recognize the CTE. I see in related post that I'm ...
0
votes
1
answer
46
views
REPLACE() function accepts and returns non-character data types
The Microsoft documentation indicates that the REPLACE() function accepts and returns only character data types. However, these work without error:
SELECT REPLACE(123456, 'X', 'Y')
;
SELECT ...
0
votes
0
answers
31
views
SQL Server cannot browse to any path
I have a local SQL installed on drive C: and the data file of those system databases are stored on a network drive path, in this case it is AWS FSx.
When I attempt to restore a user database, I cannot ...
0
votes
2
answers
38
views
Help With Creating a Trigger
I'm having a lot of doubts about creating a Trigger After Insert that after entering a new flight checks if it is the first flight of the assigned plane.
CAn you Please Help Me
0
votes
1
answer
41
views
Database design for news feed
I have one table news_feed_card which contains the following columns:
news_feed_card
id serial
card_type int
published_at date
Each news_feed_card can only have one news post. The problem is that I ...
0
votes
1
answer
25
views
schema ownership/permissions in MS-SQL vs Oracle
Hopefully I'm using the write terms here. I'm pretty good with concepts usually but don't always know the technical terms to describe it correctly. Here goes...
I'm used to working in MS SQL Server ...
1
vote
0
answers
25
views
How is text and number giving me same output with RIGHT function in MySQL?
This is SALESMAN table in MySQL:
Scode
Sname
Area
Qtysold
Dateofjoin
S001
Ravi
North
120
2015-10-01
S002
Sandeep
South
105
2012-08-01
S003
Sunil
NULL
68
2018-02-01
S004
Subh
West
280
2010-04-01
...
0
votes
0
answers
19
views
Restoring 2008 R2 db backup to 2019 causes invalid allocated space/free space
3 occasions so far I've been working with legacy 2008 R2 databases that need to be restored to SQL 2019 instances. Each db is at compatibility level 100 on the old instance. Compressed backups being ...
0
votes
0
answers
55
views
Unable to attach other 2nd MDF file Error It is not a primary Database
The windows got crashed and we copied the file from hdd to other machine..... Let me explain you ..
We have this db since many years one day the c:drive got full so the dba make changes and create new ...
0
votes
1
answer
15
views
PolyBase :: Changed database context to 'DWQueue'
I'm installing PolyBase on the latest SQL Server 2019.
During the installation I'm incurring in this error: https://www.youtube.com/watch?v=Oxd8yeiBfig (sorry for the video quality)
The proposed new ...
-1
votes
0
answers
18
views
db2 - db2relocatedb between v11.1 and v11.5 returning error DBT1023N The database release is invalid
On daily basis we are cloning database files of Db2 v11.1.4.4 on Linux/x86-64 using disk utilities. Then we are relocating metadata to get new "cloned" database with command:
db2relocatedb -...
0
votes
0
answers
20
views
Azure SQL Server grant read only access to all databases, including those created later
There is one Azure SQL Server which has 100+ databases. For auditing purposes a login is needed, that can read data (do SELECT) from all the database tables in that Azure SQL Server. Databases are ...
0
votes
1
answer
26
views
Mysql DB viewer user (only for views) should access to information_schema and test?
I've created a user in our mysql/mariaDB engine so our customers can read some views. User has been created as follows and can query the views with no problem.
CREATE USER IF NOT EXISTS "...
-1
votes
0
answers
12
views
Barman backup configuration?
I have psql1(postgres db) server and psql2(barman backup server) and I have installed the source base database on both server and using port 5141
psql1 (postgre DB server) :alias 5141="psql -h ...
1
vote
0
answers
46
views
SQL server job agent fails to execute SSIS package, the package runs fine manually
I have a job which executes two packages. Step 1 is a package which is no longer executing under the job agent although it was executing fine before the server reboot. The package executes fine ...
1
vote
1
answer
47
views
single insert ignore on a table with no auto-increment
For this table, in mysql 5.7,
CREATE TABLE `t` (
`id` int(10) unsigned NOT NULL,
`val` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
The table doesn't have ...
-3
votes
0
answers
31
views
How to save a SQL diagram as Pdf?
I tried to save the diagram as an image using the "copy to Clipboared" function and then paste it in Paint and Word. But only the tables are copied and not the content ( the attributes) of ...
0
votes
0
answers
18
views
Pgpool for HA of Postgres with repmgr switchover. Pgpool haw to follow primary
I'm trying to setup a highly available postgres (13) cluster(3 servers) with streaming replication.
I first tried native replication and then decided to use repmgr to manage this so I could use the ...
0
votes
0
answers
22
views
BigQuery -- remove duplicate rows within date range
I've searched around and found questions similar to my problem, but not with viable solutions.
Basically, I have a database of users, dates, and locations. Any user who pings the same location within ...
0
votes
0
answers
23
views
PostgreSQL Existing Column Data Encryption [closed]
I have PostgreSQL DB which needs to encrypt existing Column Data and perform full db backup (need to share backup file to developer without original column data). I see that using pgcrypto, applies to ...
0
votes
0
answers
38
views
Alter Trace (SQL Server Profiler) security risks?
SQL Server database -- a read only node specifically (not exactly sure how that works).
Our database keeps crashing due to memory issues - various error messages indicate this. It's hard to tell if it'...
1
vote
1
answer
22
views
AWS RDS Serverless-V2 Postgres restart issues
We have an RDS Serverless-V2 Postgres cluster setup with two instances (one read/write, and the other a read). Both instances are in the same AZ for now, although we plan on moving one to a different ...
0
votes
0
answers
32
views
bcp import from CSV producing strange results
I am trying to automate the monthly import of a CSV (created by pandas/Python) into a table in SQL Server 13.0.4001. There are 100k+ rows and 20+ rows in each import, and I do not have BULK INSERT ...
1
vote
0
answers
34
views
MySQL occurring responds "Error 9001: Max connect timeout" even root account
We face a strange experience. There is the MySQL we are running on GCP.
The metrics (current connection count, CPU, memory, IO, and disk) aren't abnormally high. After 06:25:01, all our connections ...
0
votes
2
answers
67
views
How to upgrade Postgres minor version from 14.x to 14.4 in Ubuntu 20.04 LTS
In 2022-06-16 Postgres released an out-of-cycle version 14.4, which fixes possible corruption on indexes created with the concurrently option in versions 14.0 to 14.3.
Needless to say, this is a very ...
1
vote
1
answer
41
views
Check int4range includes number using B-tree index
I have a table with two important columns: value and m_range, where value:
CREATE TABLE m_filter (
value BIGINT NOT NULL,
m_range ...
0
votes
1
answer
72
views
SQL Server can't create sysname type colunmn
I'm trying to create a new table based on an existing table.
In the existing one, there are two columns that are sysname data type.
But when I'm trying to create the new one with sysname, SSMS shows
...
0
votes
0
answers
36
views
SQL Failover Cluster - 'SQL Server' service terminating because of 'fatal exception c06d007e'
I have an SQL Failover cluster (2016) with 2 VMs. The 'SQL Server' service was down when seen from 'Failover Cluster Manager'. On checking the Event Viewer logs, the SQL Server showed below error.
...
1
vote
0
answers
98
views
How to install pg_amcheck in Ubuntu 20.04 LTS
In 2022-06-16 Postgres released version 14.4, which fixes possible corruption on indexes created with the concurrently option.
The release notes suggest using pg_amcheck to check if we have corrupt ...
0
votes
0
answers
11
views
Postgres 12 Move and Delete Data using (CTEs) WITH statements causing parsing issues - best approach?
Am not sure if this is the best method of moving/deleting data.
I have 2 tables play and game, information from the play table is referenced from the game table.
I am trying to find all games that are ...
0
votes
1
answer
52
views
Choosing the right database for stock price history
The model is [(stock_id, period, ts), open, high, low, close, last, volume]
We write new prices for all stocks (120,000) each minute and delete old once when they go out of retention time. It doesn't ...