Most voted "postgresql" questions
Postgresql is an open-source, object-relational database management system (ORDBMS) available for many platforms, including Linux, UNIX, MS Windows, and macOS. Please mention your version of Postgresql when asking questions.
Learn more…1,437 questions
Sort by count of
-
3
votes1
answer5437
viewsHow to call a Postgresql 9.1 function?
I have a function: CREATE OR REPLACE FUNCTION f_2(p_vetoratributos text[], p_vetorvalores numeric[]) I’m trying to call: SELECT f_2('{"0","0","0"}', '{0,1,2,3,4,5,6,7,8,9,10,11,12,13}') But he’s…
postgresqlasked 10 years, 9 months ago Tiago Casanova 131 -
3
votes2
answers3052
viewsHow to work with Postgresql array data types using Hibernate
How to perform object recovery and saving using type columns array using the Hibernate? In my case I want to save String. How I define in model the object? I found it on the net some examples but…
-
3
votes2
answers1157
viewsRails 4: Changing the "Development" database from Postgresql to Sqlite3 makes the Rails server error
Hello. For some reasons, I had to change my DB "Development" from Postgresql Rails back to Sqlite3. Only the page has stopped working and the error that appears in the server Rails output is this:…
-
3
votes1
answer60
viewsIs there any protection for the files generated with pg_dump?
There is protection of files generated by pg_dump? Anyone who has access to this file can restore it in any other database with pg_restore? Is there some protection in this file, some kind of…
-
3
votes1
answer1064
viewsI can’t connect Jpa to Postgresql at all
Good I’m trying to connect the postgresql, however, without success. My application will be an application jsf and so I’m using persistence. <?xml version="1.0" encoding="UTF-8"?>…
-
3
votes1
answer5577
viewsHow to change the default postgresql schema in persistence.xml in a java application
I am developing an application and I have a certain difficulty to change the default scheme of the application. I am using Postgresql in a Java application with JPA and Hibernate as implementation.…
-
3
votes3
answers614
viewsDatabase query in Postgresql
I am trying to make a query in Postgre with the following query: SELECT t3.desc_serv, t3.nm_serv, t1.nm_usu, count(t2.id_atend) TOTAL_ATENDIMENTO FROM usuarios t1 INNER JOIN historico_atendimentos…
-
3
votes2
answers3658
views"Connection refused" error when connecting to Postgresql
Error happens after entering login and password: "Deuorg.postgresql.util.Psqlexception: Connection refused. Check that the hostname and port are correct and that the postmaster is Accepting TCP/IP…
-
3
votes2
answers1978
viewsIn Postgresql, is there a difference between running a dump or exporting?
this question really left me in doubt, as in postgres there are three types of backup/Restore that are: SQL Dump (Generates a text file with SQL command) File System Level Backup (Save PG Data File)…
-
3
votes1
answer4700
viewsUniting several SQL queries in a single query
I have a 'mission' in my work, where I need to unite some queries in a single query. But I have no idea how I can do this so that everything I need is returned using just one query to the bank. Is…
-
3
votes1
answer1561
viewsjava.lang.Nullpointerexception Error in JDBC Connection with WS + Postgres
I am creating a WS that connects to a DB Postgresql and performs a query in a single table. I try to run it locally, but the problem is when running the application gives the following error: HTTP…
-
3
votes1
answer621
viewsI cannot import data from a CSV to Postgresql with dbWriteTable from R
I am trying to import a CSV into a Postgresql database from R. On the Postgresql server, I created an empty database, called "Data". library(RPostgreSQL) library(sqldf) drv <-…
-
3
votes2
answers263
viewsRails and postgres group_by data considering time zone
How do I group records by date where the field is datetime type? But that’s considering Timezone. For example: When the user type 12/10/2014 23:30:00, it is recorded in the bank 13/10/2014 01:30:00,…
-
3
votes2
answers556
viewsGroup Postgresql query results
I have the regular table with the query. status |curso |matricula| --------- |------|---------| Completo |Inglês|001 | Cursando |Mat |002 | Reprovado |Esp |003 | Completo |Inglês|004 | Cursando |Esp…
-
3
votes1
answer141
viewsPostgresql 9.3 Centos Structure
I would like to know what is and what is part of this directory groundwork. /var/lib/pgsql/9.3/data/base/17500/18037 /var/lib/pgsql/9.3/data/base/17500/18170 /var/lib/pgsql/9.3/data/base/17500/18168…
-
3
votes3
answers2241
viewsHow to create nonexistent columns in a Datatable?
Here is my query: select u.nome as analista, s.descricao as situacao, count(*) as qtd from tb_projeto p inner join tb_usuario u on u.id_usuario = p.id_usuario inner join tb_situacao s on…
-
3
votes1
answer464
viewsNextval Postgres Delphi problem
I’m making an application, in which I need to increment a quence and check if that value has already been used in another table, because if it has already been I must ignore and generate a new value…
-
3
votes1
answer2019
viewsCould you add a UNIQUE field that accepts nulls?
I can create a field that accepts nulls and say it is unique? This table of mine, the CRM indicates that he is a doctor and not a normal person, he has to be unique, but has to allow nulls. This…
-
3
votes2
answers1833
viewsDatabase insertion via Webservice
Good night, I know very little about Webservice. And, through tutorials, I managed to create one. The content was taken from this site: Creating Web-Service The query is successfully made, but now I…
-
3
votes0
answers378
viewsHow to see the final query that was executed? PHP PDO
I make my appointments as follows: $sql = "Select * From minha_tabela Where meu_campo = :parametro"; $sql = $db->prepare($sql); $sql->bindParam(":parametro", $parametro, PDO::PARAM_STR);…
-
3
votes1
answer92
viewsPostgressql - Stored Procedure
What’s wrong with this stored procedure? CREATE OR REPLACE FUNCTION public.sp_teste ( IN varchar, OUT codigo integer, OUT setor varchar, OUT grupo integer ) RETURNS SETOF record AS $$ begin return…
-
3
votes2
answers2034
viewsPassing values from a select to subselect
I have the following query: SELECT rp.colaborador as codigo_, t.nome, count(rp.*) as presencas, ((100 * (select count(rp.*) from empresa.cad_reuniao_presencas rp join empresa.cad_terceiros t on…
-
3
votes1
answer464
viewsConfiguration of Postgresql
I am trying to access my Postgresql database, however I am getting the following error message: I have a virtual machine Debian 8 with postgresql 9.4 installed and I am trying to access via my…
-
3
votes1
answer3905
viewsHibernate - Uplicate key value violates Unique Constraint
I have the following problem: Person: @Entity @Table(name="tb_pessoa", schema="public") @Inheritance(strategy = InheritanceType.JOINED) public class Pessoa implements Serializable { private static…
-
3
votes1
answer2293
viewsHow do I add a new column between 2 columns in Postgresql?
How do I add a new column between two existing columns in my Postgresql database? In Mysql I use the function AFTER to add one column after another, and in Postgresql? How do I do this? SQL ALTER…
-
3
votes1
answer176
viewsWhy does my Drivermanager return null Pointer?
Postgresql 9.4 I execute my class Noticias(). Within the method public static void main() class Noticias() a method is called getConexao(); When I execute pagecontroller?=p=noticias in the browser…
-
3
votes2
answers280
viewsHelp with Textbox / string parameters
I have this method where I would like to bring the IBGE. When I put Textbox as a parameter, it usually brings it, but the problem is that I am using a Library and cannot import Textbox. So I…
-
3
votes1
answer1703
viewsMigrate Microsoft SQL to Postgres
I need to migrate my SQL server database to Postgre-SQL, but I don’t have much database intimacy. Is there any tool that can assist in migrating? I have the backup of MS SQL . Bak is it possible to…
-
3
votes2
answers180
viewsSql - Natural Ordering - Varchar
Situation I need to perform Natural string ordering. Example Processo 1 Processo 2 Processo 3 Processo 10 Processo 11 Processo 12 Standard Order. (ASC) Processo 1 Processo 10 Processo 11 Processo 12…
-
3
votes2
answers1047
viewsValidation Numeric(12,2) Postgres
I have the following question, I have a field in the Postgresql database of type Numeric(12,2) when sending a value of a form I could not find a way to validate the value in PHP to insert this value…
-
3
votes1
answer2417
viewsHow to insert an encrypted field into a table in Postgresql?
I wanted to know how to insert an encrypted field into a table in the database. To illustrate my doubt let’s assume that I have the following java class: package pessoa; public class Pessoa {…
-
3
votes2
answers519
viewsProblem connecting port 80 Apache
I’m trying to use BitNami Stack MAPP 5.5.30-0 ( For Apache Web Server, Postgresql) When I try to configure Apache Web Server I get this error : "Cannot bind to port 80. It is probably Taken by…
-
3
votes2
answers439
viewsWrite data to the database (Value Member and Display Member)
I am having trouble writing this data into the database (Postgresql). In case the data you would like to save is: Customer Name Origin, Customer Name Destination, Order Date, Payment Date, Confirm…
-
3
votes2
answers46
viewsSelect of dates
I need to make a select that brings me occurrences that the initial date of a leave is less than 3 years from the date of an employee’s admission Follow below excerpt from my code. SELECT * FROM…
-
3
votes1
answer726
viewsReturn values of all months of the year extracting by month
I’m with the following SELECT: SELECT coalesce(sum(vs.total), 0) FROM tabela_exemplo t WHERE extract(year from t.data_entrada) = extract(year from current_date) GROUP BY extract(month from…
-
3
votes1
answer698
viewsCan too high an ID (auto-increment) be harmful?
I have a table that has a very high turnover of information, that is, many records enter and many leave as well. With this the ID (auto-increment) is much higher than the value of data in the table.…
-
3
votes0
answers464
viewsPostgresql Nosql and integration between relational and non-relational databases
I have been researching about Postgresql Nosql and found the concept of Key-Value Stores in some publications, also from HSTORE. I also researched the integration between Postgresql and the Spring…
-
3
votes3
answers2223
viewsHow to group for weeks using sql?
I have the following problem . I have several requests , and I want to group them for weeks. I’ve seen several examples ,almost none helped me, I wonder if there is a function that when you put it…
-
3
votes2
answers435
viewsConvert SQL syntax from Firebird database to Postgres database at runtime
I have a system developed in Delphi 7 already stable using the Firebird database, and some customers have requested that they can use Postgres as a database in the same system. As with some…
-
3
votes1
answer49
viewsJava - SQL Error Updating All Users
Good morning, I’m having the following problem my updateOur SQL is updating all how I do so that it just updates the User who accessed? public class Acessar { public static Connection con =…
-
3
votes2
answers2045
viewsPostgresql Hibernate Id Generation Strategy
I have a system in JEE7 with Hibernate and Postgresql database, the tables are with auto ID generation by Hibernate: @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; What happens…
-
3
votes1
answer852
viewsHow to change null field to not return anything?
In a query has many fields not being filled in, would like to exchange the null that is being printed so that nothing appears in the print.
-
3
votes1
answer122
viewsWhere for Inner Join
as I have three tables WHERE select login, nome_hotel from extranet_login, extranet_hoteis, hoteis where extranet_login.id_login=extranet_hoteis.id_login and extranet_hoteis.id_hotel=hoteis.id_hotel…
-
3
votes1
answer2505
viewsHow to configure Postgres to accept date in PT-BR format?
Situation Let’s say I have one form in which the user fills a field date, DD-MM-YYYY. Question How can I do the postgres accept this format normally? No need to do to_timestamp('14/06/2016',…
-
3
votes1
answer2071
viewsMaking a select in all tables of a schema
It is possible to search for a certain value in columns of other tables? Example: I have a number: 23028908 I want to search in my bank, all columns that have this value. Is that possible? How it…
-
3
votes5
answers1137
viewsPostgresql - Remove tuple referenced by another table
I’m having a problem that I didn’t find anything in Google (maybe I didn’t know to ask him) Just imagine the following: I have 11 tables, one call tbl_pai and 10 other calls tbl_filha1, tbl_filha2,…
-
3
votes2
answers1401
viewsHow to mount a SELECT with ordered nonexistent numeric column
I want to make a SELECT with some existing columns in the database and add a ordered numerical column starting at 1 for each line (I don’t want the ID). I’m using Postgresql 8.4. Example: SELECT…
-
3
votes2
answers1090
viewsShare cloud database (Postgresql)?
You can share a database (Postgresql) in the cloud, such as Dropbox, Google Drive? I want to share my database initially to access from different environments, just to start a new application. It is…
-
3
votes2
answers1286
viewsMultiply the amount of elements from two different tables
I have two tables: pessoas and carros. I would like to take the number of elements of both tables, and multiply them.
-
3
votes1
answer238
viewsHow to turn this query into a JPQL?
I have the following query in the postgres database: select * from trabalha_projeto tp inner join Empregado e on e.matricula = tp.empregado how it turns it into a JPQL query? I’m having a hard time…