Questions tagged as 'postgresql'

1
answer

Filtering API Rest Framework Django (Extra Field FK)

I would like to be able to filter by the value of another field in the table (FK) not only by id Right now if I write link it returns the results I want , but I would like to be able to filter in the following way (for another field of...
asked by 23.05.2016 / 13:18
2
answers

POSTGRESQL - Bring information from 2 tables with 1 field in common

I have the following scenario: 2 Tables Patient and Activity The Patient table contains: DNI, First and Last name. The Activity table contains: Patient's DNI, Activity. Within the activity table I have repeated the DNI of the patients s...
asked by 01.06.2016 / 16:03
0
answers

My store procedure does not return anything stored in json

I hope and they are well, I wanted to ask them what is wrong with my store procedure, what happens is that a whole query I am storing in a Json, and the problem is that the SP does not return anything, look at this It's my code: -- FUNCTION: p...
asked by 26.09.2018 / 18:32
1
answer

Sort Relationships (ManyToMany) without duplicating records

For days I have been trying to sort a series of queries by passing as parameter objects.order_by ("relation"). distinct () of type "ManyToMany" but always duplicates the query "x" the number of relations, being the Last the desired one. class...
asked by 29.04.2018 / 04:54
1
answer

Compare two postgreSQL databases

I need to compare two postgresql databases, I have a database in development and I must pass it to production but I need to see all the changes that have been made. I have used apgdiff but the expected result is not displayed. I am running th...
asked by 03.10.2017 / 16:44
3
answers

Cast in postgres operator does not exist: character varying = integer

Greetings, I'm doing an SQL query. The column to which I apply the WHERE condition is of type character varying, but the data with which I complete the condition is an integer. SELECT * FROM tablaCodigo WHERE codigo = 123 Getting the follow...
asked by 01.11.2016 / 17:15
0
answers

Replication from oracle 12c to postgreSQL

Hello friends I am trying to replicate data from a database of oracle to a database of postgreSQL , researching I have found the application oracle golden gate . The point is that I am working with two virtual machines in o...
asked by 01.02.2016 / 02:37
3
answers

Avoid duplicate records in C # and PostgreSQL

Hello colleagues I have a form where I register the members of a club but I would like to insert a record if I reject it if it already exists and if it does not exist that I insert it, this is my code. NpgsqlConnection cn = new...
asked by 19.11.2016 / 22:07
3
answers

sort images in database

Good, I have a table products and I want each product to have one or several images. so create a table images with a foreign key to products. something like this: create table producto( id_producto serial, nombre character varying(20),...
asked by 24.06.2016 / 06:44
3
answers

Generate CSV file from an SQL query

I'm working with PostgreSQL 9.6, I tried to put: COPY (SELECT * FROM estado) TO E'"C:\Users\freqde\Documents\A.csv"'; But I get the following error: no se permiten rutas relativas para COPY hacia un archivo     
asked by 04.05.2017 / 07:00