Questions tagged as 'postgresql'

1
answer

PL / PGSQL function Postgresql

I have the following function: create function sppreenchecombomunicipio(p_uf text) returns TABLE(MUNICIPIO text, COD_MUNICIPIO int) AS $$ begin return query select tb_municipio.municipio, tb_municipio.cod_municipio from tb_municipio where...
asked by 12.04.2017 / 16:01
1
answer

Cast function parameter Postgresql DEFAULT null :: int

I'm trying to create a function in plpgsql in Postgres that receives null parameters as default. Example: create or REPLACE function spinserir_0200( p_id_entidade integer DEFAULT null::int , p_cod_item bigint DEFAULT NULL::bigint, p_descr_i...
asked by 24.04.2017 / 20:23
2
answers

Problems with bake in CakePHP 3.x "Your database does not have any tables."

Greetings! I'm trying to generate models, controllers and templates in a CakePHP 3.x project using the PostgreSQL database. I already created the tables, I configured the connection (which is working, according to the default homepage of Cake),...
asked by 23.04.2017 / 03:08
1
answer

Executing a system command with a parameter inside a Function in PostgreSQL

I'm having a hard time creating a function in Postgres running a shell Linux command, with one detail: function Trigger after insert and I need to use some columns of NEW . In Mysql , using plugin...
asked by 03.04.2017 / 22:58
1
answer

Delete duplicate rows with postgresql conditionals

My code takes information from the internet and inserts it into the database, however, it inserts the same information more than once a day. I need to leave only 1 record information per day, that is, each day the program runs, it will only i...
asked by 14.03.2017 / 13:16
1
answer

Create select with various conditions

I have a table with several connections record and I need to make some conditions to separate records. I already use select to validate information SELECT count(*) as qtdade_status_dia, "TB_BASE_ACIONAMENTO".contrato || "TB_BASE_A...
asked by 07.03.2017 / 20:23
0
answers

Save IP server data

Hello, I'm trying to connect to a server. I've set up my firewall and set up the pg.conf and pg_hb.conf files to allow remote connections. it displays the following error The server does not accept connections: the connection library report...
asked by 06.03.2017 / 14:56
0
answers

Report in C #

I am trying to develop a report ( report ) in C# and using ReportViewer to display. I am using SGBD Postgresql , and I am not able to connect to the database and report , to get the data because an error occurs...
asked by 13.01.2017 / 22:13
0
answers

Error importing file with accents - Postgres

Well, I need to copy a physical file from one directory to another, but for that I need to use Postgres. I'm using the LO functions to do this. I can perfectly copy the file when it has no accents, but when I have it I get the following error...
asked by 18.01.2017 / 13:09
0
answers

How to export a table from postgres with column names to csv format with jdbc?

This is my code, which unfortunately does not export the column names: package net.viralpatel.java; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.sql.Connec...
asked by 10.01.2017 / 19:47