Questions tagged as 'postgresql'

1
answer

Pick up sales media for a given month

I would like to take the average sales of the month by product description and not date by day, month and year, but I do not know how to get it. SELECT AVG(vend_qtde) AS qtde_vendas from tb_vendas WHERE esto_descricao like '% Saco pedra %' and...
asked by 04.01.2018 / 22:56
4
answers

Postgresql - Foreign Keys Failing

Hello, I have a SALES table and a SALES_ITEM, the connection between them is done via a Cascade deleting Foreign Key and cascade update. Well, in the VENDA_ITEM table there is a trigger that runs in before delete that prevents the item fro...
asked by 17.11.2017 / 14:05
1
answer

Error connecting postgres DB with PHP

I have Postgres 9.3 installed on a Windows server 2012. I need to collect DB information for consultation on a website. I already configured the network router forwarding port 5432. In pg_hba I changed the line: host all all 0.0.0.0/0 md5...
asked by 27.09.2017 / 10:30
1
answer

I can not find the model generated by the artisan

I used the command php artisan make:model Exemplo and could not find where it saved this generated model so I could change it. I looked at the app / html folder and found nothing. My db is ready, so I do not need to use migrate, but I...
asked by 13.10.2017 / 16:25
2
answers

Tool to generate little

I have a postgres database with several tables and I need to generate their classes. Is there any free tool that manages the few to be used with EF6? I searched but did not find it. I am using VS2015 and postgres latest version.     
asked by 17.08.2017 / 01:02
1
answer

Pagination in PHP and PostgreSQL

Good night, I need a pagination made in PHP and PostgreSQL , I searched the internet but did not find anything useful, I tried to apply a PHP / MySQL code but the result was negative.    The code I used: if (isset($_GET["page"])) { $pag...
asked by 11.07.2017 / 04:01
2
answers

Do a procedure with SQL language that returns the number of clients that have no business done

I can not resolve this issue, I want it to show client numbers without primary key repeat, no business done, and show a warning if customers have business done. This error has appeared here. CREATE FUNCTION sem_negocios() RETURNS integer AS...
asked by 28.06.2017 / 03:45
2
answers

Format date when performing Update in the registry - PostgreSQL

I am saving in my database the date when a particular record is changed, but the format it is saved is (YYYY-MM-DD) , the SQL command used so far is the following: update public.transportadora set status = 'Ativo', user_update = 'Teste', data...
asked by 27.03.2017 / 22:20
1
answer

How to create entities with compound key in doctrine?

I have a database that works with composite keys, and I'm implementing the use of the Laravel framework . This is my bank structure: I'm using doctrine as an ORM and found that I can not automatically generate the entities of the datab...
asked by 05.04.2017 / 16:19
1
answer

MongoDB Integration with ASP.NET MVC 5 and PostgreSQL

I am building an ASP.NET MVC 5 project with PostgreSQL database, in this database there is a history table that will grow by about 500,000 lines per month and we will have reports that will take data from periods of one year. So we thought abo...
asked by 20.03.2017 / 15:25