Questions tagged as 'postgresql'

1
answer

I can not do a function that returns a Semester of a Date in PostgreSQL

I'm trying to do a conversion that returns a semester of a date, but this error appeared here CREATE or REPLACE FUNCTION semestre ( data timestamp ) RETURNS INTEGER AS $$ BEGIN IF data <= 6 THEN return 1; ELSE return...
asked by 16.06.2017 / 14:38
1
answer

Data insertion error java null, Java Postgre Database

I'm trying to insert data into a table in the database, but it returns error "null." public void cadastrarChamadas() { Chamadas1 cha= null; String sql = "Insert into tb_chamadas(cha_cod , cha_nome, cha_defeito, cha_datainicio, cha_dat...
asked by 20.01.2017 / 12:33
1
answer

Removing "BC" from Timestamp dates in Postgresql

Hello, I'm trying to remove the "BC" from sql dates but I'm not getting it. I do the following: SELECT CAST("regiaulaavul_dataInicio" AS date) FROM "RegistroAulaAvulsa" And it turns out to return the date with a BC (Before Christ) in fron...
asked by 26.01.2017 / 13:06
1
answer

Apache tooltips to develop in php with Postgresql

Well, I want to develop in php, so I need to install a tool that will make my pc turn half the server, as everyone knows there are several tools to download such as: XAMP, WAMP, EASYPHP etc. All of these support MYSQL DBMS. I would like to kn...
asked by 20.12.2016 / 19:11
2
answers

How to limit the amount of addresses that a user can have in the database

I have a database, and I have the user table and the address table. I need to validate in some way so that a user can have a maximum of 5 addresses in the registry. I use the PostgreSQL database and treats an application with Servlet. Any sugges...
asked by 24.11.2016 / 20:23
1
answer

Error DLL Connection FireDac with PostgreSQL

I'm having the DLL error not found when making a connection to PostgreSQL using the FireDAC component. Error: [FireDAC] [Phys] [PG] -314. Can not load vendor library [C: \ EXE \ libpq.dll]. Hint: check it in the PATH or application EXE dire...
asked by 17.11.2016 / 18:52
2
answers

PostgreSQL pg_hba.conf

I have a server with a servlet + a database in postgreSQL. I would like only the servlet to connect to the database. When I configure pg_hba.conf with local all all md5 the servlet can not connect to the database. Then I need to configure i...
asked by 01.11.2016 / 18:51
1
answer

Perform PostgreSQL Update by PgAdmin without SQL command, but by Interface

I need to change some data from my bank PostgreSQL to PgAdmin but I would like it to be straightforward through the PgAdmin interface and not through SQL commands, this is possible. For example when I want to create a new co...
asked by 16.01.2017 / 12:40
1
answer

Restore base in container with Postgres

I am using a container with postgres on an EC2 server and I want to restore a base in this container via linux command. Any tips? I was trying as follows: sudo docker exec -t postgres_94 pg_restore -c -U postgres > minha_base.backup    ...
asked by 27.10.2016 / 20:30
1
answer

DB modeling for "multilevel marketing"

Personal speech, I'm working on an app that consists of people referencing, just like so-called multilevel marketing. The general idea is to: Person A indicates person B (LEVEL 1) if person B indicates person C (person N1 of person B a...
asked by 10.11.2016 / 16:51