Questions tagged as 'postgresql'

1
answer

Foreign Key between different databases

Is it possible to link between two different databases in one Migration? I'm using Postgres. What I have: $table->integer('id_cliente_produto')->unsigned(); $table->foreign('id_cliente_produto')->references('id_cliente_produto')...
asked by 27.06.2016 / 20:10
2
answers

Sql - Delete records in bulk - Delete in bulk

I have a table with about 4 million records. What is the best method to delete all of them to get the best time? Does Indexing help anything, since it is just a reference for finding data? OBS 'DELETE FROM tb_name;' // Demorou em torno d...
asked by 09.10.2015 / 15:39
4
answers

Insert cities into the database

Hello, I am creating a database, and I will have information from Brazilian municipalities, I imagine that I am certainly not the first to need this information, but I am not aware if there is any way to do this automatically, I can download thi...
asked by 05.03.2015 / 13:24
2
answers

Error adding information in DB

When testing the application where I migrated the Firebird DB to PostgreSQL, the following error occurs when trying to save an item in the database: Reviewing the code I could see that the error actually occurs at this point in the code...
asked by 21.11.2016 / 20:58
1
answer

SQL: How to count values in different columns

I would like to know how to count values in different columns. Generic example: ID - COLUNA1 - COLUNA2 1 - foo - Bar 2 - - Foo 3 - Qux - Bar 4 - Bar - I expect as a result count - value 2 - Foo 3 - Bar 1...
asked by 11.01.2016 / 11:09
3
answers

RETURN THE SUM OF MAXIMUM 3 VALUES IN SQL

I have a table and need to return the following: check based on the recipient column, add up the 3 largest amounts of that recipient, bring in the query only if the sum of the 3 largest are > = 1024: CREATE TABLE TRANSFERS( SENDER VARCHAR2(...
asked by 12.06.2018 / 19:56
1
answer

Silent installation of Postgres and creation of the base in installer

How can I embed the PostgreSQL database in my WinForms system installer? I can even put it as a prerequisite to install before the system binaries, however, I wanted to do a silent installation. I would also like to know how to create the ban...
asked by 22.09.2016 / 14:54
2
answers

Syntax error when creating table in PostgreSQL using Hibernate

@Entity public class User { @Id @GeneratedValue private int id; private String name; private String email; private String sex; private int age; private Date birthday; private Date registerdate; private...
asked by 12.11.2014 / 15:20
2
answers

How to insert current date in postgresql?

I need to set in a column in postgresql the current date of the insertion as default value for the field. How can I do this?     
asked by 27.09.2016 / 21:13
1
answer

I can not save the information to a local database!

I'm having trouble saving the information entered by the user in the PostgreSQL database, I've developed an application in Android Studio and I'm using an external local database with PostgreSQL to save the data, however when I run the applicati...
asked by 08.09.2016 / 02:46