Questions tagged [operator]
The operator tag has no summary.
45 questions
5 votes
2 answers
760 views
Is there a meaningful explanation for this weird PostgreSQL behaviour of the char datatype?
In PostgreSQL (9.6), suppose that we have a table with a char(3) column with an empty string: create table ztest (col1 char(3)); insert into ztest values (''); Why do the operators CONCAT, ||, = and =...
0 votes
0 answers
64 views
Replicate a Crunchy operator OCP cluster to VMs
I am trying to implement a scenario in which there is a PostgreSQL cluster on OCP using the Crunchy operator and for reasons it should be replicated to a VM running a full PostgreSQL installation. I ...
-1 votes
1 answer
983 views
How to list sum of values in the specific period
Sorry for very newbie questions. I have a table, shown below with values about duration of events. Sometimes I have several events in one hour/day. Instead of showing each particular event, I would ...
0 votes
2 answers
146 views
Explaining what the OR operator does in the following code
I ran into the following SQL code which (successfully) outputs a list of parents and the age of their youngest child: SELECT parents.name AS name, MIN(children.age) AS age FROM people children INNER ...
6 votes
2 answers
5k views
PostgreSQL - CAST vs :: operator on LATERAL table function
While I can SELECT elem[1], elem[2] FROM ( VALUES ('1,2'::TEXT) ) AS q(arr), LATERAL CAST(String_To_Array(q.arr, ',') AS INT[]) AS elem ; using an explicit call to CAST, I can't SELECT ...
0 votes
2 answers
902 views
comparison operator in count() is not working [closed]
The query (SELECT 15 > 14 FROM Duel) Working in MySql, but when I tried in MS-SQL Server getting following error: SQL Error(102): Incorrect syntax near '>' I have a requirement where I want to ...
3 votes
3 answers
862 views
PostgreSQL Operator Class for index support of custom operator
I'm trying to create an index that will support queries that use my custom operator. This is on PostgreSQL 10.4. The custom operator I followed the tips in this SO answer to create an operator that ...
4 votes
2 answers
2k views
Different syntax to add/substract interval
Till now I used the following syntax to add an interval to a timestamp: select now() + '5 year'; This worked fine till I tried to subtract the interval which results in a syntax error. invalid input ...