How to reset postgres' primary key sequence when it falls out of sync?

I ran into the problem that my primary key sequence is not in sync with my table rows. That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial...

Bulk/batch update/upsert in PostgreSQL

I'm writing a Django-ORM enchancement that attempts to cache models and postpone model saving until the end of the transaction. It's all almost done, however I came across an unexpected difficulty...

PDOException: SQLSTATE[IMSSP]: error occurred translating string to UCS-2, using drupal 7 at azure and sql azure backend

I recently started setting up a drupal 7 website on Azure cloud using a web role and SQL azure backend. I was very much pleased until I hit a character set brickwall. I have a virtual machine with...

safe enough 8-character short unique random string

I am trying to compute 8-character short unique random filenames for, let's say, thousands of files without probable name collision. Is this method safe...

Large server-side data: JSON vs XML vs JSTL EL

I'm working with a web where many queries have to be performed to a MYSQL database. I use Java+Tomcat as development environment. I have tried different ways to solve this: At the beginning I...

PHP move_uploaded_file not working, yet no errors generated

I have a file upload page, and I have gone through the code and inserted debugging lines incrementally, line-by-line, to try to find the cause of this problem. The problem occurs somewhere in this...

Can we use shell variables in awk?

Can we use shell variables in AWK like $VAR instead of $1, $2? For example: UL=(AKHIL:AKHIL_NEW,SWATHI:SWATHI_NEW) NUSR=`echo ${UL[*]}|awk -F, '{print NF}'` echo $NUSR echo ${UL[*]}|awk -F,...

XAMPP - MySQL shutdown unexpectedly

When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn't working. 12:19:12 PM [mysql] Attempting to start MySQL app... 12:19:12 PM...

Getting "Invalid column type" exception, while using NamedParameterJDBCTemplate for insertion

I am using below code while inserting a row into database(oracle 10g xe,jar: ojdbc14.jar) String sql = "INSERT INTO SPONSOR_TB(ID,NAME,INDUSTRY_TYPE,IS_REPORTING_SPONSOR,IS_NOT_SOLICITE)...

Can't start mysqld/mysql

first I have to say I'm a mysql newbie. Basically mysql does not start and says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) Now Here...

Error : Cannot use identity column key generation with <union-subclass> ( TABLE_PER_CLASS )

I am using Hibernate to save entities where all entities are inherited from a base abstract entity. For all concrete Entities there are database tables respectively, with autoincrement primary key...

Grant privileges for a particular database in PostgreSQL

I'm moving from MySQL to PostgreSQL and have hit a wall with user privileges. I am used to assigning a user all privileges to all tables of a database with the following command: # MySQL grant all...

logging on Azure

How can we log on Azure withe the granularity & control equivalent to log4net? We use log4net in our web apps we run on IIS and that works very well for us. Is that the best on Azure too? We...

Sequence Diagram for Registration and Reporting

I am doing sequence diagrams, but I have some issues in the design of these diagrams. So I was doing the diagram for Account Creation as follows: So, first the user goes to the registration page...

SQL Server Auto Incrementing Identity Per Customer(Tenant) With No Gaps

We have a multi-tenant database which holds multiple customers with each customer having a collection of users like so (Simplified example omitting foreign key specification from users to...

Handling Unicode sequences in postgresql

I have some JSON data stored in a JSON (not JSONB) column in my postgresql database (9.4.1). Some of these JSON structures contain unicode sequences in their attribute values. For...

Xcode Version 7.1 beta 3 Cannot attach to process when debugger is enabled

I can no longer install my app to my iPhone 6. (With debugger enabled in the executable, when disabled it installs just fine) I need to get some logging when from my device, but when I install it...

Why does Oracle add extra tables to my ddl export

Probably this is trivial, but I'm not sure why Oracle creates extra tables when I export my relational design as a ddl. CREATE TABLE WHY ( Col1_ID INTEGER NOT NULL , Col2_ID INTEGER NOT NULL )...

typeorm: auto generated UUID in postgresql

I am writing an REST API and for data access I am using typeorm, I have used this successfully but I would like to have a UUID auto-generated primary key on one of my tables. Does anyone know how...

MariaDB service continuosly fail to start

I'm having some trouble on a server with MariaDB installed on. The mariadb process stopped working suddenly for the first time a few days ago and when I try to reboot it doing sudo service mariadb...

Why I am not able to refer to my sequence with double quotes in postgres?

I have created sequence in postgres. postgres=# create sequence my_sequence start 5 minvalue 3 increment 1 cycle; CREATE SEQUENCE Now I am trying to query the next value from the...

Postgresql ADD SERIAL COLUMN IF NOT EXISTS still creating sequences

I call the command ALTER TABLE tableName ADD COLUMN IF NOT EXISTS columnName SERIAL in postgresql. The first time this is run, a new column is created with a corresponding sequence as desired....

Devart.Data.Oracle.EFCore - How to use sequence to set PK column value?

I'm using Entity Framework Core 2.1.4 with Oracle 11 database and Devart.Data.Oracle.EFCore provider. Database first approach. I want to get from sequence value for ID column (primary key) on...

How to analyze poor performance from Azure PostGreSQL-PaaS

I'm experiencing poor performance from Azure PostGreSQL-PaaS and need help with how to proceed. I'm trying out Azure PostGreSQL-PaaS in a project. I'm experiencing an intolerable performance from...

Specify name of Oracle IDENTITY sequence?

I’m using Doctrine to connect to an Oracle database. At the moment I’m just testing locally. However, when we move to production it seems there’s no way to specify the IDENTITY sequence name...

BeanCreationException: Error creating bean with name 'flywayInitializer'

I am trying to run my project tests in a docker container. All of the tests work just fine when running locally. Errors started occurring when I tried to move my testing to docker container. Here...

How to increment id without auto increment?

I have a table with id column as a number which have meanings. Different types of accounts start from different ranges. E.g Organisation 10000 <-> 100000, users 1000000 <-> 1kk. How can i properly...

How to run a mango query on a couchdb view?

I use the python package couchdb to access a Apache CouchDB. My task is to filter documents from the database and be able to select from the filtered database documents with a mango query. I have...

Recovering InnoDB database from backed up "data" folder in XAMP in Windows 10

I copied the data directory from mysql folder and uninstalled the XAMPP as the MySQL was not starting. I installed XAMPP same version and backed up the data folder into mysql data directory. At...

why I got this error Sequence contains no elements

I am using the following code in the view and tried a lot of solutions but still get this error Sequence Contains no elements , this is the view code : @model...