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
-
0
votes1
answer96
viewsCreating Energy log table for several Django models
I have 30 models. Each of them contains information from a calculator and each record is information from sub-calculators. I need to create a log table of each calculation made by the user.…
-
0
votes1
answer29
viewsI need to show you the details of the customer who bought the most
This query is giving error: select c.* from carrinho_de_compras as cc inner join clientes as c on c.codigo = cc.cod_cliente inner join produtos as p on p.codigo = cc.cod_produto where (select…
-
0
votes0
answers53
viewsHow to store </br> and n in the database, and then show in HTML when it is called?
I’m storing it in the attribute off_desc the description of an offer, but even if in Textarea I insert line breaks, in the database and in HTML (When I try to collect the data), they are all shown…
-
0
votes0
answers81
viewsHow to pass data from a Jtextfield to a Postgresql Date field
I urge you to help me solve a problem of entering data type Date (SQL) to register new students in the Crud project developed by me in the code below. The method containing the INSERT INTO command…
-
0
votes1
answer43
viewsSelect only returns result in terminal
I’m having trouble understanding why the code below only returns result when executed in the terminal. I intend to return hash of the last id entered in the database connection =…
-
0
votes0
answers16
viewsInsert + sign into a table field with PHP
Follow the SQL command of the Insert that I need to insert in the table, the database is Postgres. '''INSERT INTO pneu_templates (ds_template, cd_brand, cd_usercadastro) VALUES (UPPER('test+'), 86,…
-
0
votes0
answers15
viewsError while using Raw from typeorm postgres
all right? I am having a problem in my application, I am using postgres with typeorm and when I try to use the find method with a Raw on Where, it presents the following error: "error": "column…
-
0
votes0
answers52
viewsAlternatives for backslashed commands in Postgresql
I’m learning to use the Postgresql instead of Mysql and Sqlserver, but I’m still lost with some basic commands. So far, the only one I’ve been able to get acquainted with is this: listar os bancos…
-
0
votes0
answers13
viewsIt is possible to pivot with varied values to turn into column - SQL
Hello! I am studying sql, and I am doubtful, I am with a sample bank, and I have the following situation, I have a product code, and an Ean code in products, for Ean code it repeats the product…
-
0
votes1
answer264
viewsSave only the year in a date field on Postgres! RAILS
I have two fields called start_year and end_year, in which I want to save only the year that the user will select and save in the database. But when you save the form that is processed by RAILS, it…
-
0
votes0
answers17
viewsPython problem in postgres on MAC
Guys, I’m testing Trigger functions with python on Postgres and I’m having problems when I go to test on my Mac. Follow the function: create function sendchange() returns trigger as $$ import…
-
0
votes1
answer538
viewsHow can I make a trial to update the balance in postgres?
Mine has been giving an error that I can not understand talking q is wrong in $, but when I used another example internet trial almost in the same way as mine worked, then the mistake is being on…
-
0
votes0
answers33
viewsLaravel Custom Authentication with Postgres
I created a custom provider, called CustomUserProvider, extendi of EloquentUserProvider and brought the perfect fields. However the login does not persist public function…
-
0
votes1
answer593
viewsInserting a JSON object into a JSON field in Postgresql with Python
Good morning, everyone, I have the following problem, I made a Crawler and it receives the information, but at the time of formatting it in json format and insert in the database presents error.…
-
0
votes1
answer66
viewshow to capture an id dynamically and sequentially in postgresql?
It refers to an audit table that I am creating, the objective in question is to record the fields of the table in question. But I can’t capture id ex: create or replace function…
-
0
votes0
answers70
viewsPostgres does not accept commands. "Invalid Binary" error
Good afternoon, you guys. I am installing Postgres and while trying to create the database by the command line interface, postgres me the following message in case he’s not accepting any commands.…
-
0
votes0
answers74
viewsDoubt how to make a thread with select and cancel query executed in the database
I am running a query within a thread and set a time limit for it to run or else stop would be the user himself can cancel the select. The problem is that I stop the thread but the query keeps…
-
0
votes1
answer233
viewsProblem when creating a connection between PHP and Postgresql
I am unable to make the connection to the Postgresql database. Follows the code: <?php class Conexao { private $usuario; private $senha; private $banco; private $servidor; private $porta; private…
-
0
votes1
answer532
viewsSELECT DISTINCT in JSON column in postgresql
I have a table that has 2 columns, id (int auto_increment) and Resp (json). In this table I have duplicate values in the column Resp, something like that: id | resp…
-
0
votes1
answer75
viewsQuery Beego problem
I’m having problems to mount a Query in Go, using the Beego framework. Error: 2018/12/20 09:21:32.104 [C] [asm_amd64.s:522] Handler Crashed with error Runtime error: invalid memory address or nil…
-
0
votes2
answers65
viewsInsert in Postgres with Python is not working
I need to include data and a database of my own, but I can’t and I’m not able to solve the problem. My code is this:: import psycopg2 conn=psycopg2.connect("dbname='teste' user='postgres'…
-
0
votes0
answers119
viewsAdd counter - Postgresql
I have the following Query: SELECT array_to_string(array_agg('"'||public.lotesretornosuprimento.codigoestoque||'"'), ', ') as codigos, est.codigosuprimento, public.suprimento.suprimento, ( select…
-
0
votes0
answers190
viewsECONNRESET with postgres and sequelize in nodejs
Good we are using nodejs v10.13.0 together with him the sequelize 4.42.0 to communicate with our bank postgres 9.2, our server is in AZURE it has 8GB of HAM, 2 CPU and is Centos 7. In the bank we…
-
0
votes1
answer166
viewsSUM operation doubling query value - Laravel
I am with a query that is with some problem in which I cannot identify. I need to bring up the additional sum and journey. The problem is that when I add in the bank the value of the journey and no…
-
0
votes1
answer66
viewsIs there any way to divide one table into several small ones and keep the querys?
I have a problem on my server, my table artigos has 5.5 million lines and a normal select takes about 8 seconds to run. I didn’t have a brilliant idea, I will divide my table into 10 tables, and the…
postgresqlasked 5 years, 9 months ago Vinicius Morais 1,293 -
0
votes1
answer103
viewsEncoding problem in Codeigniter
I use Postgres as a database and my table is set as UTF8. ENCODING = 'SQL_ASCII' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' But when I make an appointment he returns to me like this. I’m…
-
0
votes1
answer49
viewsWarning when using ibase_fetch_object()
I have an app PHP that synchronizes data from one database to another, at a given time, when consulting a database Postgre, after properly completing the variables $db and $sql I have the following…
-
0
votes1
answer51
viewsSet primary keys in sequence
I have the table empresas as an example: cod | nome ----|---------- 3 | Asterix 7 | Lunar 13 | Coimbra Fortunately the table of companies currently has no reference in another table, I would like to…
-
0
votes1
answer454
viewsVery time consuming query depending on query ID
Hello, I have a fairly large query that is running in the bank, follows. SELECT "p"."id", "fr"."apelido", "fr"."compra_minima", "fr"."desconto", "fr"."aplicavel_todocarrinho" FROM "basket" "b" JOIN…
postgresqlasked 5 years, 9 months ago Jhonny 97 -
0
votes1
answer474
viewsError executing login() 'Anonymoususer' Object has in attribute '_meta'
I’m trying to log into an account of Django to redirect to the main page of my project, but the command login returns me the following error. AttributeError at /login/ 'AnonymousUser' object has no…
-
0
votes1
answer209
viewsBackup in Postgres
postgres has some system table you can select to find out when the last backup was done just like its status (it ran normal or failed) ? That is, how to remove as much backup information in postgres…
-
0
votes1
answer279
viewsDivision between postgresql functions
I have two functions that, when performed separately, return me values without problem. Turns out I need to divide one by the other but it’s not working. Função 1 select…
postgresqlasked 5 years, 8 months ago Jonata Champan 1 -
0
votes0
answers34
viewsupdate postgre going wrong
Follows the code: def update_table(file_name, id, column1, column2): conn = connect() c = conn.cursor() today = str(datetime.datetime.fromtimestamp(int(time.time())).strftime('%Y/%m/%d/')) query =…
-
0
votes1
answer88
viewsLaravel + Postgres - Return’t' or 'f' instead of true or false
Hello, When performing a query in a field booleano in the Postgres we have a return of 't' or 'f'. I’m having a problem trying to migrate an API made in Codeigniter for an API I am developing in…
-
0
votes1
answer77
viewsProblem in configuring Datasource with Postgres!
I am trying to configure my Datasource to create a REST API, the same is not working when using Postgresql, but if using Oracle DB works normally. I would like to use Postgresql, can anyone tell me…
-
0
votes1
answer202
viewsHow do I not select repeated data that contains a specific value in SQL in a column?
Good evening guys, I’m beginner with Database, I have a Query that runs a filter following a rule: Rule: GSM which is repeated, and has in both STATUS = 'TEMPORARY ANOMALY' and its MOTIVO_ENVIO is…
-
0
votes1
answer179
viewsExport Postgre SQL table to text (csv) via psycopg2
I am trying to export a table from the Postgres database to a txt (csv) file via Python, via psycopg2. However, I am encountering an error. The code is as follows (I switched login information to…
-
0
votes1
answer327
viewsUpdate json field with select in the same Postgresql table
I have a table where I have to take data from a record and update it in a column from another record of the same table. These fields are like json. I was able to get the data to be entered but I’m…
-
0
votes1
answer54
viewsSQL grouping product balance by company
What I need to do is I need to put together a report that will return the stock of products by individual companies. select must return the following:…
-
0
votes1
answer196
viewsError when adding foreign key to table
I get the error message: SQL Error [42703]: ERROR: column "tela_inicial_id" referenced in Foreign key Constraint does not exist ERROR: column "tela_initial_id" referenced in Foreign key Constraint…
-
0
votes1
answer77
viewsGet free hour ranges with SQL only
I am creating an agenda and need to perform a consultation of the interval between scheduled times. Example: Tabela: HORARIO_ATENDIMENTO INICIO: 08:00 FIM: 18:00 Tabela: Agenda ID: 1 HORA_INICIAL:…
-
0
votes0
answers231
viewsSave an image of Imagemview to Postgres
Hello, I am making a screen where the user takes photo of the error and sends in our program. The routine loads the image of both the Camera and the Gallery and I put in Imageview, in this part…
-
0
votes1
answer269
viewsSelect from and Insert into another database with Python
I’m trying to select a DB from Azure and after that insert the data into a postgresql DB. I tested the separate connections and both are working, but when running the full code nothing happens until…
-
0
votes0
answers26
viewsData migration postgresql reformulate table
The title may imply that I am recreating a table with similar attributes, but the term is as follows:: I have a database currently running in my application for study purposes, there is a class…
-
0
votes1
answer86
viewsDatabase Query with an Array in Hibernate
I have a method that takes as parameter an array of values(id) and I need to do a query in the database to return only the rows of a column with these values(id) I have this method: public…
-
0
votes0
answers90
viewsSum all values in a column and group every 2 minutes
I wanted to add up all the values every 2 minutes and group those same values valor tempo 0.3 2019-05-22 01:11:45---> first value 0,3 0.3 2019-05-22 01:12:16-----| 0.3 2019-05-22…
-
0
votes2
answers105
viewscreation of tables to register questions in postgresql
I’m making a program where the user can register and search for questions. Each question has a domain (e.g., law, psychology), various themes, a difficulty, the text of the question and the answer.…
postgresqlasked 5 years, 5 months ago J. Weslley 38 -
0
votes1
answer94
viewsInner John and Left John problem
I am using the Postgresql + C database# I have a Type that we can call Main. Inside it I have a long id, string name, I have a Classea, Classeb, Classec. Both the Classea, Classeb, Classec may or…
-
0
votes0
answers40
viewsIncrease the number of vehicles with Trigger
I have the table pessoa who has the spine qtd_veiculos, every time I give one insert with a new vehicle, which has the CPF foreign_key same as some person at the table pessoa, this column should be…
-
0
votes0
answers805
viewsorg.postgresql.util.Psqlexception: ERROR: Operator does not exist: bigint = bytea
I have a method that retrieves all paths from the appendices of a ledger, so the appendices can be printed. They are listed in a p:datatable within a dialog, but when opening the screen so that I…