Questions tagged as 'postgresql'

1
answer

Change column type of PostegreSQL Database

I need to change the column type of a table I'm using the following code: ALTER TABLE cadastro_remetente ALTER COLUMN ssl_smtp DROP DEFAULT; ALTER TABLE cadastro_remetente ALTER COLUMN ssl_smtp SET DEFAULT FALSE; ALTER TABLE cadastro_reme...
asked by 12.01.2016 / 15:14
2
answers

Difficulty to Mount SQL Query with UNION with SUM

I have 2 tables that stores different sales type, and I need to add everything to get the value to generate the collection, but I'm not able to mount the sql query, as follows: SELECT CL.NOME,CL.id_cadastro_cliente, sum (L.VALOR_LANCAMENTO) a...
asked by 14.12.2015 / 20:19
1
answer

Error while doing INSERT - Laravel 5.1 + PostgreSQL

I have date fields on my form, but these fields are optional. When I fill in a date the registration is successful, but if I leave the empty date field I get the following error: SQLSTATE[22007]: Invalid datetime format: 7 ERROR: invalid input...
asked by 18.12.2015 / 20:23
2
answers

DAO + Webservice

I want to use the DAO standard to create a Java project in Eclipse to view data from a database. I just want to turn it into a Webservice .. How should I proceed? Just use that IDE Webservice creation option and you're done?     
asked by 07.10.2015 / 20:30
1
answer

Date - date_trunc for PHP

PostgreSQL has a date function called date_trunc How can I play it in PHP? I only need the options: second minute hour day week month quarter year
asked by 30.10.2015 / 18:03
1
answer

Count in PostgreSQL using OVER

I have a teacher evaluation table and another one with student assessments: tbl_professor id | nome ---------------------------- 1 | José 2 | Maria 3 | Paulo tbl_avaliacao id | idprofessor | avaliacao | data --------------------...
asked by 16.10.2015 / 06:16
1
answer

JSF calendar with datatable having data from different lists

I'm making software in JSF (2.2), primefaces and JPA with Postgres bank. I need to make a schedule of accounts payable with the following columns and their data: Column before yesterday with data: due date, vendor and value. Column yesterday wit...
asked by 26.06.2015 / 14:40
2
answers

Persist JSON Postgres / Golang

Hello, is there any way to persist a JSON in postgres with GO language? I do not want to do a manual insert, I want to map my JSON with a struct and persist, similar to hibernate in Java. I found this lib link Convert my JSON to BSON...
asked by 16.04.2015 / 13:36
1
answer

How do I access the PostgreSQL consoles?

I recently purchased this book and I have followed the guidelines on how to install PostgreSQL for the Windows operating system: Icanmakeallthechangespossibleintheinteractiveenvironment,butIwanttohaveaccesstotheconsolemoduleasIamaccustomedt...
asked by 07.04.2015 / 11:37
1
answer

How to check if a table date is lower than today's date in Doctrine - Postgresql

I have to check if the user has registered an expiration date, if yes, check if that date is less than today if it is, it shows if it does not hide, I did so: $this->noticia = Doctrine::getTable('Noticias')->createQuery('s')...
asked by 27.03.2015 / 18:28