Tag Info

New answers tagged

1

MongoDB at least to current version 2.6+ for sure does not support that as build-in functionality. I guess because a replica set using selective replication won't be consistent. There is a feature called filtered replication in Couch but never tried it: http://wiki.apache.org/couchdb/Replication#Filtered_Replication


3

Yes you can. Per documentation: Note that the user performing the insert, update or delete on the view must have the corresponding insert, update or delete privilege on the view. In addition the view's owner must have the relevant privileges on the underlying base relations, but the user performing the update does not need any permissions on the ...


0

I would suggest reading this whitepaper on database version control from DBmaestro TeamWork (where I work) Basically, it discuses how database enforced change management combines the enforcement of version control processes on the database objects with the generation of the deployment script when required based on the version control repository and the ...


0

Before deciding you need to consider a few things: How many rows are we talking about? How many in the table as a whole How many are part of the same tournament (assuming that you will have multiple tournaments in this table, and that points are assigned per tournament) How many entries are added per tournament? This will tell us how many "update" ...


0

You cannot move just indexes to another location. You have to move both data and indexes. When you use innodb_file_per_table, this will create a file with the extension .ibd. For example, if you have an InnoDB table as follows datadir /var/lib/mysql database mydb table mytable The physical files are the following /var/lib/mysql/mydb/mytables.frm ...


0

I think a spin-off of option 2 would be ideal based on your requirements that seem to only be for presentation and not further computation. You query the database for all the scores from match X and order them from high to low. Then in the presentation layer of the web application, simply add ranked number assignments to them starting with 1 for the first ...


0

As far as I understand, an idempotent script is something that can be applied multiple times but has the same effect as if you only applied it once (i.e. it can be re-run without having an adverse effect). It's definitely worth having idempotent scripts as part of your release so that you're not causing issues if you accidentally run the same script multiple ...


1

You can REVOKE access from that schema, but I am affraid the application will have some unwanted effects. PostgreSQL has fine tuned permission administration. And later you can GRANT access to that schema.


0

You're setting custom format. Remove the -Fc option from the pg_dump command so the dump will be generated with COPY commands. Add set schema 'myschema'; at the beggining of the file. then psql -U my_username -h localhost -d my_db -f db/my_dump.backup -v ON_ERROR_STOP=1


1

ALTER SESSION SET CURRENT_SCHEMA will work, but you still need to do all of the grants. – Phil Oct 29 at 23:33


2

I would go with a traditional set-based approach for this. Create entity, list, entityList, and listItem tables to store your data. Individual list and entity tables allow you to create lists without entities and vice versa. Constraints on these tables such as unique constraints and foreign keys will help preserve the integrity of the data. For the list, ...


0

The fact that the ExternalID is in an arbitrary format should not impact the design of the schema. As it's a many to many relationship, you can use the following: Customer - ID - Name - etc... CustomerCompany - CustomerID (PK, FK to Customer) - ExternalID - CompanyID (PK, FK to Company) Company - ID - Name - etc... Depending on the business logic, it ...


1

You could probably use an XML datatype to store the lists. This way, you'd preserve the ordering as well. Haven't done any extensive performance testing, but with typed XML (a schema) and an XML index on the column, this might work for you. As for insert performance, one advantage of this approach is that you only have to make an insert into a single table, ...


1

You can create a new schema and expose the objects you need with a synonym: USE master; GO IF DB_ID('testDatabase') IS NOT NULL BEGIN ALTER DATABASE testDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE testDatabase END GO CREATE DATABASE testDatabase GO USE testDatabase; GO -- test table in schema dbo CREATE TABLE dbo.test ( ...


0

This query select pslo.stasubtype, pc.relname, pslo.statime from pg_stat_last_operation pslo join pg_class pc on(pc.relfilenode = pslo.objid) and pslo.staactionname = 'CREATE' order by pslo.statime desc will help surely. NB: It works only on greenplum.


0

For anyone who's curious, I ended up doing it the first way: Insert a re-post doc in posts docs collection. The doc inserted doesn't contain any of the re-posted doc's info, just a reference to its ID under a "reposted_id" field. It also includes info about the reposter. The query for the feed will match either the author ID or the reposter ID. From the ...


3

The answer is a little bit like the old joke: "Doctor, doctor! It hurts when I do this." If you want a foreign key to an entity then that entity needs to have a unique key defined to be referenced. The fact that your Expectations table has a unique candidate key in Expectations.ExpectationId should not prevent you from defining another candidate key that ...


0

Sorry to resurrect an old question Recently I have been using the 0xDBE Database management tool by JetBrains (Currently in Early Access Program). It supports multiple database engines, in the excellent Jetbrains IDE, and a key feature I have found useful is the ability to diff 2 tables (DEV and PROD). Below is a screenshot of the diff in action (in ...


2

The basic answer is: No. Do you have a record of the 18-20 digit value somewhere? In another location in your database, on a piece of paper on you desk, etc? If so then use the source information to correct your error. You have not indicated which database software you are using, which can make a difference for many issues.


4

SELECT set_config('search_path', 'fred,'||current_setting('search_path'), false); The false says it's not a transaction-LOCAL setting. For the bonus question, you can store the value in a custom setting: SELECT set_config('tmp.search_path', current_setting('search_path'), false); From version 9.2 on, you don't even have to define this setting in ...


0

If you go for the Option 1, how do you Identify the Affiliate? and that's why I think Option 2 is better, unless I am missing something



Top 50 recent answers are included