Questions tagged as 'postgresql'

1
answer

Because I get this error

   ERROR: duplicate key violates uniqueness restriction «matricula_pkey»   DETAIL: The key already exists (cod_est, cod_asig) = (1085, 1080). SQL   state: 23505 At the time of entering the data of a table this error appears, and my database...
asked by 20.05.2018 / 23:43
0
answers

Trigger between three tables

On the one hand, article table (code_of_bars, price_article), ticket (ticket_id, total_price) and finally the table that relates them formed (id_ticket, code_of_bars). I want that every time an entry is added in formed the price of the ticket is...
asked by 19.05.2018 / 11:24
2
answers

how can I declare a variable in postgresql?

I need to declare a variable timestamp in postgresql but when I try it it gives me syntax error, if someone could give me the code of how to declare and assign value to a variable it would be very helpful, thanks     
asked by 17.05.2018 / 18:05
0
answers

Google Charts gives me error when bringing queries with an empty conditional

Good afternoon, I'm currently working with the Google Chart charts and it works almost perfect, I'm working with a mail system and I want you to show me a graph of the shipments that have been made during the year, the problem is that if a clien...
asked by 22.05.2018 / 19:33
0
answers

Make one column depend on another

I need that when inserting a row, one data is updated in function of another. In this case I intend that number2 be updated to be the same as number1, but the trigger does not work CREATE FUNCTION igual() RETURNS trigger AS ' BEGIN new.numer...
asked by 18.05.2018 / 19:49
1
answer

Division in postgreSQL shows incorrect result

I have the query that returns the value of an index that is the result of an operation between two columns, the result I want in decimals and shows it that way, what happens is that the result is not correct: here I leave my query: SELECT dep....
asked by 09.05.2018 / 17:01
0
answers

Problems generating correct graphics with php, google charts and Postgresql

Currently I am trying to show through a graph the query of a record in postgresql from php but I can only show one of the fields consulted. For example I want to show the total of packages sent by a mail office in total was received by the post...
asked by 21.05.2018 / 17:23
1
answer

Copy table in postgres if it already exists

I have managed to get the table I need thanks to the question: postgres copy tables sudo pg_dump -i -h server-address -p 5432 -U postgres -t product_attribute_line -F p -b -v -f "product_attribute_line.sql" database-name My problem comes...
asked by 04.05.2018 / 13:21
2
answers

How to compare a list and eliminate duplicates?

I have a list in which when editing a record, add a new one in the database, this new record is practically the same as "edit", but change an id that I want to change; at the time of calling the list I want to replace the old value with the new...
asked by 27.07.2018 / 17:45
1
answer

Modify data from a listbox in python with tkinter using postgresql ... mouseEvent

I have an interface where I show a list of data from different clients with a Listbox. I was wondering if it is possible to select a data from there and that can be modified directly? those are the data that I have in postgresql a...
asked by 08.05.2018 / 22:27