Questions tagged [postgresql-8.0]

For PostgreSQL questions specific to version 8.0.

While the generic tag should probably be used with all PostgreSQL-related questions, this tag should also be used if the question pertains to features added in version 8.0, or if the question is about a problem seen while running version 8.0.

17 questions
6
votes
2 answers

Redshift PostgreSQL Distinct ON Operator

I have a data set that I want to parse for to see multi-touch attribution. The data set is made up by leads who responded to a marketing campaign and their marketing source. Each lead can respond to multiple campaigns and I want to get their first…
4
votes
4 answers

REDSHIFT: How can I generate a series of numbers without creating a table called "numbers" in redshift (Postgres 8.0.2)?

I need to create an empty time table series for a report so I can left join activity from several tables to it. Every hour of the day does not necessarily have data, but I want it to show null or zero for inactivity instead of omitting that hour of…
3
votes
2 answers

SSL connection error in PostgreSQL 8.0

We have an application that connects to PostgreSQL 8.0, 9.0 or 9.5 (different versions for different clients). Recently we decided to add SSL connection for more security. Everything seems good on 9.0 and 9.5 but not in 8.0. Here is what I do to…
Georgi Bonchev
  • 269
  • 4
  • 12
1
vote
3 answers

SQL- Return rows after nth occurrence of event per user

I'm using postgreSQL 8.0 and I have a table with user_id, timestamp, and event_id. How can I return the rows (or row) after the 4th occurrence of event_id = someID per user? |---------------------|--------------------|------------------| | …
Indy
  • 75
  • 6
1
vote
1 answer

Optimized querying in PostgreSQL

Assume you have a table named tracker with following records. issue_id | ingest_date | verb,status 10 2015-01-24 00:00:00 1,1 10 2015-01-25 00:00:00 2,2 10 2015-01-26 00:00:00 2,3 10 2015-01-27…
0
votes
2 answers

How to limit group by statement to 1 column

(Apologies if this sounds familiar, I deleted and re-uploaded my question as I had tagged the wrong version of SQL in error) I have a table with data on appointments, each appointment can have multiple rows of data as and when associated data is…
D D
  • 1
  • 1
0
votes
1 answer

... WHERE ['ID_two','ID_four'] COINTAINS_AT_LEAST_ONE_ID_FROM ['ID_one','ID_two','ID_three']

I would like to have an SQL query where I check if one ID (of an array with ID's) matches at least one ID out of an array of other ID's. The ID's are stings. It should be like: SELECT * FROM table1 WHERE table1.ids COINTAINS_AT_LEAST_ONE_ID_FROM…
0
votes
0 answers

Query to collapse records if record is substring and falls in a time interval

I have the below events data: events table event_id | timestamp | label -------------------------------------------------- 1 |2021-11-15 10:23:54| so 1 |2021-11-15 10:24:30| software 2 |2021-11-15 10:24:54| software…
Bikas Katwal
  • 1,895
  • 1
  • 21
  • 42
0
votes
1 answer

Rollup data hierarchy in postgresql 8.0?

I am trying to rollup in postgresql 8.0. In latest version on postgresql we have ROLLUP function, but how to implement rollup in postgresql 8.0 ? Anyone have experience with the same? I tried the below SELECT EXTRACT (YEAR FROM rental_date) y, …
0
votes
2 answers

How to convert unix_timestamp interger in psql?

How to convert a unix_timestamp integer to time in readable text. Such as: timestamp|integer|not null default 0 select timestamp from table limit 1; 1541001600 1541001600 should be converted to Thu Nov 1 00:00:00 CST 2018 PostgreSQL 8.0.2
Cow
  • 99
  • 7
0
votes
1 answer

Need Sorting With External Array or Comma Separated data

Am working with PostgreSQL 8.0.2, I have table create table rate_date (id serial, rate_name text); and it's data is id rate_name -------------- 1 startRate 2 MidRate 3 xlRate 4 xxlRate After select it will show data with…
Chetan Pagar
  • 1
  • 1
  • 3
0
votes
1 answer

SAS to PostgreSQL(PADB) code - summing field if they exists

I'm having a challenge with a piece of code from SAS that I need to convert to SQL. Usually I'm very good at this but right not I'm facing a new challenge and so far all my ideas to resolve it are failing and I'm not finding the right way to do…
Wired604
  • 370
  • 1
  • 3
  • 10
0
votes
0 answers

When replicating tables, what is the best way to mirror removed records from original table?

Context Let us say there is table A. Table B replicates table A by using an upsert statement on a file that has only the updated records found on table A. It is easy to tell whether table A records where updated, as it will reflect on the column…
0
votes
2 answers

syntax error at or near "(" postgresql + Python

I'm using a Jupyter notebook for working with some database with postgresql I have the following instances: import pandas as pd import (other packages) conn_string= % I can't show this, but this is ok conn =…
L F
  • 548
  • 1
  • 7
  • 22
0
votes
2 answers

how can I use window function - difficult case in PostgreSQL

I have a table like below: group sequence action 1 1 promotion_1 1 2 promotion_1 1 3 promotion_2 1 4 act1 …
1
2