Questions tagged as 'postgresql'

0
answers

Remove row from table and set IDs

Greetings. I am a beginner in the database and wanted to know the correct way to remove an item from the table and update the identification number of the others. This is the typical rookie problem, which removes the item and unconfigures the...
asked by 21.05.2017 / 04:39
1
answer

Condition and loop within a function

I am creating a function to output inventory, where v_saldo_item_peps is a function that returns a table, with the items that have balance, in their respective entries. I need to check if v_saldo_item_peps returned some result a...
asked by 19.06.2017 / 16:30
1
answer

Export DESCRIBE TABLE from Postgres to txt

Is it possible to generate a .txt file with the DESCRIBE TABLE from a table in Postgres by PHP? I need to download a .txt file with the description of the fields (name, type, character size) of the table where the query is being made.     
asked by 02.05.2017 / 15:09
1
answer

Request ajax does not return what I want

I have a registration page with a form, the person types the year and clicks the button to search the register. With the typed year I have to make the request for PHP to execute the query, return the data and distribute the data to the fields of...
asked by 20.04.2017 / 17:37
1
answer

Fill null field with first non-null first field

Good afternoon, I wanted to populate the null fields with the first non-null first field in an entire table. Do you know if you can? How is the table: Howshouldthetablelooklike:     
asked by 18.04.2017 / 21:12
4
answers

Workbench for PostgreSQL

Does anyone know of any Workbench for PostgreSQL? I need it, because I do not want to move postgres through the command line.     
asked by 29.02.2016 / 15:27
1
answer

Query between two different databases postgresql cakephp

I have two distinct database clients and tickets . Where in the clients_tickets table of the clients database a configuration is stored that I need to access certain values in tickets . So I tried to use construct of cakephp...
asked by 20.03.2017 / 14:31
0
answers

Delete duplicate lines postgresql

My code automatically inserts data into a database, causing the DB to become too large, and sometimes with repeated information. For this, I want to use the Slowly Changing Dimension (SCD) method so that: - A record with a given id will be added...
asked by 15.03.2017 / 15:01
0
answers

mysql accusing error when trying to insert a timestamp

I'm trying to pass a timestamp per parameter to a function, but I end up getting a ERROR: invalid input syntax for type time: "10" The section where I pass is: select agendar('2010-01-01 10:00:01') The snippet you receive is: CREATE...
asked by 14.03.2017 / 03:29
1
answer

postgres compare time extracted from a timestamp

I need to extract the hours and minutes of a timestamp in mysql, I tried to use maketime (); CREATE OR REPLACE FUNCTION agendar(dia timestamp) returns bool as $$ declare hora time := extract(hour from dia); minuto time := extract(minute from...
asked by 13.03.2017 / 03:16