Questions tagged as 'postgresql-9.3'

1
answer

How do I consult in a table from a column "json" the rows that contain only one data in that column?

I have a table as follows: CREATE TABLE partes( id INTEGER PRIMARY KEY, id_padre INTEGER, tipos JSON ); I insert the sample data: INSERT INTO partes (id, id_padre, tipos) VALUES (1, 0, '["1","2"]'), (2, 1, '["2"]'), (3, 1, '["2","1"]...
asked by 13.07.2017 / 20:35
2
answers

How to count records of 3 tables linked by a foreign key?

I have a main table with one record, and in the other two tables there can be several records that depend on the record in table 1. I need you to show me only 1 record as it appears in image 1, but adding 3 more columns corr...
asked by 25.01.2018 / 06:51
1
answer

final part of a QUERY

I am finishing a query that I have been asked but I can not finish it, the structure of the tables is as follows: child CREATE TABLE CHILD( child_id SMALLINT, child_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, gender VARCHAR(255)...
asked by 30.10.2017 / 20:08
1
answer

Syntax error in Stored Procedure

I have a problem compiling, what happens is that it generates syntax error, the detail is that I'm just learning from stored procedures, look at this is my function: Note: I edited my question and it was already executed correctly, only that...
asked by 09.10.2018 / 19:19
1
answer

convert a process stored in sqlServer to Postgresql

Good evening I have here processes stored in sqlserver and I would like to implement them in postgres , I just need you to please explain what is the output element in postgres and the varable as there are many and it would not be c...
asked by 11.12.2016 / 03:13
1
answer

Switch from milliseconds to a time in hours, minutes and seconds in Java

I have a variable in String and it is the milliseconds that it takes to get from one point to another. I need to put that value in Hours: Minutes: Seconds format I am using Java 6 and objects Date , but when I send this value to...
asked by 10.11.2016 / 15:14
1
answer

Is there a log of the querys executed in Postgresql?

I have been using postgresql 9.3, I would like to know if there is any log of the querys executed, and if there is a way to activate it so that one is generated     
asked by 07.10.2018 / 01:35
1
answer

laravel filter results by date range

Hi, I need to filter according to a particular range of dates. I'm trying to do it on my own but it has not gone well. It is giving me this error. I want to filter by the field Date_emission below is the model of my table "SQLSTATE[22007]: Inv...
asked by 07.06.2017 / 17:37
1
answer

INSERT IN REMOTE TABLE FROM LOCAL POSTGRESQL TABLE

using postgresql, the following instruction updates a local table from a remote table: INSERT INTO tblA SELECT id, time FROM dblink('dbname=dbtest', 'SELECT id, time FROM tblB') AS t(id integer, time integer) WHERE time > 1...
asked by 11.05.2017 / 15:33
1
answer

Generate Postgres output in columns

I am trying to make a query in a Postgres database where I want to get results in the form of a table as follows. Variables 1, 2 ... n are the names of the sensors that are known (from the list in the query). Then, the result would be for each d...
asked by 07.03.2017 / 09:29