Questions tagged as 'postgresql'

2
answers

Dynamically sort SQL result

First of all, Working specifically with Java in the Backend using WebServices Rest and PostgreSQL, after some professional enhancements I was directed to pass ordering and paging of my application to SQL, which would overload the application ser...
asked by 18.09.2017 / 21:26
1
answer

How to call a bank function from code

I would like some help, I have the following function that is in the database postgres CREATE OR REPLACE FUNCTION public.get_id(campo character varying) RETURNS integer AS $BODY$ DECLARE _id integer; BEGIN select into _id vlr_c...
asked by 29.08.2017 / 17:17
1
answer

Error entering data into bank

I'm doing a java system with postgresql database for client registration, any help is welcome to solve my problem. org.postgresql.util.psqlexception: ERROR: syntax error at or near "," Posição:50 Control class: public class ControleCli...
asked by 11.08.2017 / 05:56
1
answer

Error Stack Underflow and Access Violation Delphi 7

I am changing the database of my Delphi application from Firebird to PostgreSQL, however in some points of my application when I am accessing information from the Bank the following error message occurs: ButIhavenoideawhatmightbecausingthise...
asked by 04.11.2016 / 20:14
1
answer

MYSQL to POSTGRESQL via SED

I'm looking for a way to migrate my backup from a MySQL database to Postgresql. The simplest way I found was by using sed on top of the backup, but it did not work. It was as follows: 1 - Performing a backup 2 - Running the command s...
asked by 13.10.2016 / 18:39
1
answer

Persisting in the Bank from a file

What would be the most efficient way to read a file and write to the Postgres database? I'm posting a code where I can do it, but postgres limits me to the connection number. Nowfollowtheerror:Set12,20168:53:39AMorg.hibernate.tool.hbm2ddl.Sc...
asked by 12.09.2016 / 14:06
1
answer

Group query for similar but not identical records

I need to migrate a database (from SQL Server to PostgreSQL and I'm creating an ETL interactive in PHP to make this change), which is about 10 years, some 2 million records in the table clientes no has verif...
asked by 03.09.2016 / 20:32
1
answer

How to find a string that varies in position

See below two results returned from a table where I store sqls query execution plan. I use POSTGRESQL I need to capture only the string cost = 399301.55 of the result below. The word cost always comes at the beginning, but it does not always com...
asked by 14.01.2017 / 20:58
1
answer

Do rows delete in several tables dynamically, in Postgres

I need to do a delete to clean the database automatically on tables that are within different schemas, the "public" and "cine"; I have the following query that returns me SELECT concat('"',table_schema,'"', '.', '"',table_name, '"') as...
asked by 23.03.2018 / 17:57
2
answers

How to create a FUNCTION to format currency in POSTGRE?

I created one, but it did not look right there: CREATE FUNCTION formatar_moeda(valor FLOAT) RETURNS VARCHAR(15) AS $$ DECLARE formatado VARCHAR(15); BEGIN SET formatado = NUMBER(valor,2); SET formatado = REPLACE(formatado,'.','#');...
asked by 24.05.2016 / 02:54