Questions tagged as 'postgresql'

1
answer

Error = tuple index out of range ... problem with postgresql and python

I have the following function: def Buscar(self): comando="SELECT * FROM tipo_inversion where id='"+self.palabra.get()+"';" conectar=Base_de_datos.BaseDeDatos() conectar.cursor.execute(comando) #rows= conectar.cursor.fetchall()...
asked by 05.03.2018 / 03:58
1
answer

Print column name as headings with bd postgresql and python

I have the following code of a PostgreSQL table, I need you to print the name of columns as a header, with Tabulate and Python, I only get the numbering of the columns as a header, I do not know why: cur.execute("""select * from admin_eps""")...
asked by 01.03.2018 / 17:29
2
answers

problems BD filled [closed]

My doubt is that I do when my BD is full for example I use postgresql and I already have a lot of information, since it is used to store information every 5 minutes when performing a continuous monitoring of the local network of the company, as...
asked by 01.03.2018 / 16:04
1
answer

Query in Disorder PosgreSQL

How could I do a SQL query by inserting a string with words in any order? For example find a row that has in some column the following String: "my dog is called spike" inserting in a like something like "dog my llama spike" Let's see the foll...
asked by 27.02.2018 / 23:41
1
answer

PostgreSQL nested query

I have a table used with the following structure: I want to get the head of each employee who is identified with the head column. I have the following nested query to get what I'm looking for, but it does not return the names of the...
asked by 06.02.2018 / 19:56
2
answers

Create an update from an if or a case in sql or postgresql

I'm doing an inventory program for a project with RFID. The problem is having the inputs and outputs controlled. When something comes out of the store, it does not necessarily come out permanently so it can re-enter, the problem is that the o...
asked by 10.01.2018 / 18:53
1
answer

How to do a stored procedure in postgresql for login?

This is my db model in question of users It turns out that I need that with the same credentials the user can log in, the intention is to create a procedure where the server returns their user data, and teacher and administrative if it is,...
asked by 09.01.2018 / 23:30
1
answer

HIBERNATE JPA POSTGRESQL, error in Persistence.xml

My persistence.xml file looks like this: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/...
asked by 09.01.2018 / 14:31
1
answer

Postgresql Sub Query

Greetings. Currently the query I am using (without variables) does the necessary work, but now I need to add variables within it. INSERT INTO tabla2 (a,b,c,d,FK_ID) SELECT a,b,c,d FROM tabla1 In table2 I have a column fK_ID, how could I add...
asked by 15.12.2017 / 20:37
1
answer

function year (date) does not exist

I have the following query in mysql runs fine, but in postgres I mark error in YEAR (dias_festivos.fecha) = '2000', says:    function year (date) does not exist Does anyone know why? This is the query: SELECT dias_festivos.id, dias_f...
asked by 16.12.2017 / 21:04