Questions tagged as 'postgresql'

2
answers

Help creating a Dynamic Insert in PostgreSQL

I have a table Juego which has 4 columns nombre, tipo, autor, proveedor , the function that I create allows me to enter data filtering according to characters correctly, but I would like to write the columns and the value of the arr...
asked by 13.07.2018 / 02:55
2
answers

Help creating a function in PostgreSQL that inserts datps in columns with a delimiter character

I have a table with characters Name, Aepllido, Cedula and Date of Birth, and I receive a series of sentences similar to Luis*Lopez*273982*24/12/1998|Juan*Gonzalez*232234*03/12/1987|Julio*Perez*274234*03/12/1995 I want to be able to delimit...
asked by 10.07.2018 / 17:57
0
answers

Get fields changed in a trigger

I am doing an audit system and what I have done is a trigger in which the inserted is obtained and saved as JSON in a column, as well as the deleted, but I also want to save the changed fields between inserted and deleted, in postgres I did it u...
asked by 06.07.2018 / 12:01
0
answers

Use data newly inserted in Postgresql

Good day! I tell them what I want to do, this is the application cycle. What I need to do is starting from the user id ( id_user ) obtained in a query I do, delete in the table " user_status " the row where that id_user matc...
asked by 04.07.2018 / 14:30
1
answer

Query in PostgreSQL returns NoneType

After creating a user in my database in my application implemented in Heroku, I enter the registration page if it succeeds. When I try to log in, make the following query: result = cur.execute("SELECT * FROM users WHERE username = %s", [userna...
asked by 03.07.2018 / 17:28
0
answers

Error in PostgreSQL trigger - UPDATE

I have a question for you. I am developing a database in which I have a table called "currencies", which has a field called dvs_local (boolean) which indicates which is the local currency of the system (only one of the table - TRUE, the rest mus...
asked by 04.07.2018 / 01:47
0
answers

problem when restoring a Database

I have to restore a bd in postgresql , with a file dump and when I run the script it gives me an error here:    1 1 Default Nomenclature 1 2018-06-08 21: 33: 01.779138 2018-06-08   21: 33: 01.779138 always       ERROR: syntax error...
asked by 27.06.2018 / 21:36
2
answers

postgres primary key change change

Hello having a created table I would like to know if I can change the primary key for example for my table where I want anho to be the new primary key instead of id id | anho | modelo ------------------ 1 | 2010 | new 2 | 201...
asked by 05.07.2018 / 16:09
0
answers

migrate query ON DUPLICATE KEY UPDATE mysql to ON CONFLICT DO UPDATE SET of postgrest

I have the following MySql query INSERT INTO codigo_postal (d_codigo, d_asenta, d_tipo_asenta, d_mnpio, d_estado, d_ciudad, d_CP, c_estado, c_oficina, c_CP, c_tipo_asenta, c_mnpio, id_asenta_cpcons, d_zona, c_cve_ciudad) VALUES ".$da...
asked by 27.06.2018 / 23:54
0
answers

Problems with datatable when displaying data

function vistas_due_listasedes(Request $request) { $estable = $request->get('estable'); $anio = $request->get('anio_corte'); $mes = $request->get('mes_corte'); $sedes = HistoricoSede::select(...
asked by 27.06.2018 / 16:48