Questions tagged as 'postgresql'

1
answer

Save only the year in a date field in Postgres! RAILS

I have two fields called start_anno and termino_an, where I want to save only the year that the user will select and save to the database. But when you save the form that is processed by RAILS, it saves year, month, and day. IwouldliketoknowifI...
asked by 20.11.2018 / 03:21
1
answer

How to escape quotes from a json key in Postgresql?

I have a function that receives JSON's, it happens that the user can put it like this: Normal : '[{"nome":"João Carlos"}, {"nome":"Maria Silva"}]' Problem : '[{"nome":"João - "Carlos" - "}, {"nome":"Maria Silva"}]' Note that it is...
asked by 26.11.2018 / 16:54
1
answer

QueryDSL with abstract class

I need to make a query that returns an abstract object. In case when my code arrives in the ".list ()" it throws an exception, on the other hand, if I use ".list" but returning an attribute of this object it works. I just want to know if quer...
asked by 05.02.2014 / 15:36
1
answer

Problem creating a connection between PHP and PostgreSQl [closed]

I am not able to connect to the PostgreSQL database. Here is the code: <?php class Conexao { private $usuario; private $senha; private $banco; private $servidor; private $porta; private static $pdo; //Método co...
asked by 19.12.2018 / 14:32
1
answer

Serial ID not assigning to model id

I'm making a website that gets through a Webservice, the data from a dvd (from a colleague's website), and creates an offer with its information. I think I'm having a problem with MVC structuring and not with the framework itself. public funct...
asked by 17.10.2018 / 18:44
1
answer

Django + Postgresql object has no attribute

I'm trying to do a validation before sending my form, however it returns me the following error: 'StudentForm' object has no termAccepted attribute app models.py: from django.db import models from django import forms from django.forms...
asked by 28.08.2018 / 21:07
1
answer

Compare SQL result using PHP

I started a session and performed a SQL query <? session_start(); $_SESSION['modulo'] = "WebSocialSocial/"; $_SESSION['root'] = substr(__FILE__, 0, strpos(__FILE__, substr($_SESSION["modulo"], 0,-1))); $_SESSION['linkroot']...
asked by 22.08.2018 / 16:12
1
answer

Convert VARCHAR to TIMESTAMP (AWS REDSHIFT / POSTGRESQL)

I have the following problem, in the source I have the data coming as varchar Sample source data in varchar format: 08:15:49 18:16:05 20:01:33 etc ... I need to re-insert this data into a new table so I made an insert with the f...
asked by 04.07.2018 / 23:26
1
answer

Generate file D-1

How do I select data in D-1 format (current day - 1), what would VBA be a AGORA() - 1 , how would this be in postgreSQL? I have the following query and would like to get the day from yesterday to generate reports. select * from...
asked by 25.06.2018 / 15:13
1
answer

RichEdit Delphi text mess up while writing to PostgreSQL database

I have tried almost everything. I have a system in DelphiXe6 with PostgreSQL, in it I have some Text type fields that I need to write formatted text (bold, italic, background color, etc.) type word, it works blz, except when I save the text f...
asked by 27.06.2018 / 16:15