Data dodania Pytanie
2017-03-18 23:03 How to find the number of matches a player has played? »
I have two tables namely match and player. I am trying to find the total number of matches played by each player by adding no_of_wins and no_of_loses ...
(2) odpowiedzi
2017-03-18 16:03 How to save JS Date.now() in PostgreSQL? »
I tried to use PostgreSQL timestamp datatype, but it throws an error ERROR: date/time field value out of range: "1489849402536" The schema create...
(1) odpowiedzi
2017-03-18 14:03 Heroku - Disable Postgresql SSL? »
I have a PostGIS database on Heroku and I want to connect my external GeoServer to it. I can't do it because Geoserver does not support SSL and Heroku...
(2) odpowiedzi
2017-03-18 10:03 Getting ProgramLimitExceeded: ERROR from order_as_specified gem »
I am using order_as_specified gem, to order my records in a custom order reach_order = [3,1,67,43,...] influencers = Influencer.order_as_specified(id...
(0) odpowiedzi
2017-03-17 21:03 Postgresql dense_rank manipulation »
I have a table like this: Name | Time | Sam | 10:58 | Sam | 10:59 | Sam | 11:10 | Tom | 1:16...
(2) odpowiedzi
2017-03-17 16:03 Database Exception: Command `pg_restore` not found with odoo9 »
While,Trying to restore database form database manager then getting this error. ...
(1) odpowiedzi
2017-03-17 16:03 PostgreSQL index search on JSONB type »
I have a postgres database with tables like this: CREATE TABLE state ( id SERIAL, keys JSONB NOT NULL ); CREATE INDEX keys_idx ON state (keys...
(0) odpowiedzi
2017-03-17 15:03 RecyclerView items refreshing while scrolling »
When I scroll down to RecyclerView items refresh. For example the items has up and down vote and also has total comment and total vote. Every item a...
(0) odpowiedzi
2017-03-17 00:03 Ruby Sequel dirty status on json column not working using Postgresql »
Using sequel 4.29.0. I'm planning to use the before_save sequel hook to trigger an action, In this case I need to make sure if an specific column ch...
(1) odpowiedzi
2017-03-16 21:03 Can't connect to postgresql server after moving database files »
I want to move my postgresql databases to an external hard drive (HDD 2TB USB 3.0). I copied the whole directory: /var/lib/postgresql/9.4/main/ to ...
(0) odpowiedzi
2017-03-16 17:03 namedParameterJdbcTemplate batchUpdate vs INSERT INTO SELECT »
I'm performing an experiment where I want to see what approach to inserting multiple records into a PostgreSQL database is going to give me the best s...
(0) odpowiedzi
2017-03-16 13:03 Create PostGreSQL schema and add tables »
I want to make graphic installer that asks user few questions and then creates schema and populates it with tables. I Will use yii\db\Command's create...
(0) odpowiedzi
2017-03-16 12:03 Should I prefer ->> or @> »
In postgreSQL on a JSONB column I can run two queries with the same (?) result. Query 1: SELECT * FROM a WHERE b->>'c' = 'lorem'; Query 2: ...
(3) odpowiedzi
2017-03-16 08:03 Postgres - No actual UPDATE, has it side-effects? »
I have a table which holds about 50M rows. I want to execute a simple UPDATE query: UPDATE the_table SET flag = true; For 99% of these rows, the fl...
(2) odpowiedzi
2017-03-15 19:03 JUnit testing - Hw can I set up my DB connect to avoid tests failing due to maximum DB connection reached »
I am doing some DAO testing in Java, and I have defined a class that sets the connection to the testing DB like this import io.dropwizard.testing.Res...
(1) odpowiedzi
2017-03-15 19:03 Using activerecord-postgis-adapter and point is not cast as spherical »
I'm trying to create a basic app using the activerecord-postgis-adapter gem and am following the instructions in the readme. According to the readme,...
(2) odpowiedzi
2017-03-15 13:03 How to use IN clause with multiple columns on same data in postgresql? »
I have a query like this: SELECT c1 from t WHERE c2 IN list1 AND c3 IN list1; I want to combine this query to get somthing like this: SELECT c1 fr...
(2) odpowiedzi
2017-03-15 09:03 Optimizing Rails Query »
is there anyway else to optimize this query? It takes about 44ms to run but would love for it to be much lower. Any ideas?? @@accepted_list = Histor...
(0) odpowiedzi
2017-03-15 09:03 Postgres jsonb, nested array querying to hide specific fields »
I have a jsonb data of following format, with nested arrays { "outerArray": [ { "price": { "amount": 108.95, "currencyCod...
(1) odpowiedzi
2017-03-14 23:03 postgresql convert jsonb to set of records »
Having issue with transforming jsonb to desired table type, any help would be appreciated. My jsonb is: {"left": ["ICMB", "IPERIOD", "IADDR", "KV"]}...
(1) odpowiedzi
2017-03-14 22:03 How to Never Retrieve Different Rows in a Changing Table »
I have a table of millions of rows that is constantly changing(new rows are inserted, updated and some are deleted). I'd like to query 100 new rows(I ...
(2) odpowiedzi
2017-03-14 22:03 GROUP BY query slower when the data is in JSONB vs JSON »
In a Postgres 9.5 db I have 111K+ rows of data, and on the below group by query I noticed that there was a significant performance difference. SELEC...
(0) odpowiedzi
2017-03-14 18:03 Mode over a one year window in PostgreSQL »
I have a Redshift table of transactions from members, and associated to each transaction is a state: date|member_id|transaction_amount|state --...
(1) odpowiedzi
2017-03-14 18:03 Substring search on JSON data (ERROR: cannot extract element from a scalar) »
I've been looking at this tutorial and this example trying to find a performant way to query by substring with JSON (<9.5)/JSONB (*9.5) data. For ...
(1) odpowiedzi
2017-03-14 17:03 SQL + Rails - is it posible to get a collection of objects with the values of attributes from other table columns »
class Baby belongs_to :child attr :is_public scope :public, includes(:child).merge(Child.public).where('babies.is_public IS TRUE') end class Ch...
(1) odpowiedzi
2017-03-14 15:03 Rails How to retrieve act-as-taggable-on tags on multiple levels of associations »
Summary I have acts_as_taggable_on :skills in my Ad.rb Model. I have the following relationships: Host Model has_many :locations Location has_many...
(1) odpowiedzi
2017-03-13 22:03 How to get value of a key inside an jsonb array in postgres and JOIN »
I have data that looks like inside a json table in postgres with a column called content has data similar to {schd:[{key1:val1, key2:val2}]} The w...
(1) odpowiedzi
2017-03-13 19:03 Rails 4 or 5, index on "updated_at" column in Postgresql. What it means? »
I'm using Rails 5 with this: def index @posts = Post.all fresh_when(etag: @posts, last_modified: @posts.maximum(:updated_at)) end A friend of m...
(1) odpowiedzi
2017-03-13 17:03 How to display query without executing it with eloquent »
I want to display a query without executing it using Eloquent. I want to write something like: \DB::table('my_table')-> updateOrInsert(['a' => ...
(2) odpowiedzi
2017-03-13 10:03 Rails .where() query not working »
Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I perform the following query on Location Model. @locations = Lo...
(1) odpowiedzi
2017-03-13 05:03 Add read replicas for SilverStripe website »
I've managed to get a stable load balanced front end servers that can scale horizontally quite well however the next bottle neck would be the db. Ther...
(1) odpowiedzi
2017-03-13 02:03 Ecto build multiple assoc »
Currently working on Phoenix project using Ecto + Postgres. When creating a comment, as comment belongs_to both User and Article, is there a way to bu...
(2) odpowiedzi
2017-03-12 22:03 DBD::Pg double-encodes UTF8 characters when inserting data »
I am trying to insert UTF8 strings into PostgreSQL, using DBD::Pg and always get double-encoded UTF8 in the database. I only get the correct character...
(0) odpowiedzi
2017-03-12 19:03 Ruby on Rails - List Cities with most recent updated timestamp for Place »
I have a model Place, that has a city, state, timestamps, etc. Obviously, I can have multiple Place records in a given city. What I need (for my sit...
(1) odpowiedzi
2017-03-12 17:03 Postgresql is the server running locally and accepting connection on Unix domain »
I am trying to install postgresql-9.5 or postgresql-9.6 on my ubuntu 16.04 or 14.04 machine, after following the installation process using below comm...
(2) odpowiedzi