Questions tagged [postgresql-8.2]

Questions specific to version 8.2 of the widely-used PostgreSQL relational database system

This tag is for questions specific to version 8.2 of the widely-used .

Official documentation for this version: http://www.postgresql.org/docs/8.2/interactive/index.html

For general PostgreSQL questions, use the tag.

42 questions
0
votes
2 answers

How to generate last date of every month between two dates in PostgreSQL?

I want to generate a list of last date of every month between two dates. For example, i want to generate From 2004-01-31 to 2005-08-31 and the result should be like…
nia a
  • 15
  • 3
0
votes
0 answers

Postgresql 8.2 Data dump to Postgresql 10

I have two servers Windows Xp (running Postgresql 8.2) Ubuntu TLS 18.o (running Postgresql 10) I have a table which contains blob data of images and fingerprints in PostgreSQL 8.2. Application was built on VB6. I migrated the database dump to…
0
votes
1 answer

How to save multiple functions as each files(*.sql) in Postgresql?

I'm using PostgreSQL version 8.2 and trying to save all functions/views source code as each files on a local. But it seems to be impossible to extract each function's code to each files. example: I'd like to save source files like below: function…
Ben
  • 45
  • 1
  • 1
  • 6
0
votes
1 answer

Postgres Error : Invalid Page header in block xxx, But Fine while run with 'Order By'

I run this query on Postgres 8.2 Database (Windows) : SELECT * FROM (SELECT * FROM table1 tb1 WHERE date='2019-03-06' ) tb1 JOIN table2 tb2 ON tb2.tb1_id = tb1.id WHERE tb2.date ='2019-03-06' then i got this error message…
adhi
  • 35
  • 8
0
votes
0 answers

new column with values depending upon another column

I have a column "current stage" which can take values from 2 to 8.Based upon it my new column"possible stages" should have the values as 2 to current stage-1. For example: if "current stage" is 5, possible stages should be 2,3,4 .(in sequence) if…
umakant
  • 49
  • 10
0
votes
0 answers

CakePHP 3.x Support for PostgreSQL 8.0 - 8.2 Database

From what I can tell CakePHP 3.x support claims support for PostgreSQL 8+ but in practice I found that out of the box there is a missing cast before PostgreSQL 8.3 for regclass::text. If you attempt a simple model in CakePHP 3 you will get an error…
carcus88
  • 137
  • 1
  • 7
0
votes
0 answers

PostgreSQL Recursive Function Not working

I have a requirement to get the hierarchical structure for the employees. Below is the current recursive function I am using: WITH RECURSIVE resource_tbl AS ( select pers_id,pers_full_nm,mgr_id,mgr_full_nm, 1 as level from resource UNION…
0
votes
0 answers

How do you read a file name from a table

I build the following table (it adds yesterday's 8 digit date to some text): create table DayBefore as select (current_date -interval '1 Days')::timestamp::text; update daybefore set text = substr (text, 1, 10); update daybefore set text = replace…
NigeH
  • 3
  • 3
0
votes
1 answer

Move data from one table to another with Redshift

I wanted to move log datas that have a specific user_id to a new table on Redshift. I've started playing with WITH block like : WITH moved_rows AS ( DELETE FROM sensor_log_enable USING sensor_log_disable WHERE sensor_log_enable.user_id …
Mio
  • 1,412
  • 2
  • 19
  • 41
0
votes
1 answer

PostgreSQL 8.2 extract week number from a a date field

This might be a simple one but I haven't got a solution yet. I have a create_date field which is a date type, and a revenue number. I want to see weekly break down of revenue. I can get the numbers easily in tableau because of built in…
Nemo
  • 1,111
  • 6
  • 28
  • 45
0
votes
1 answer

Return SETOF rows from PostgreSQL function after WHILE LOOP section

I am trying to create a POSTGRESQL function which would first INSERT some data in a table using WHILE LOOP and then SELECT the results of this table. This is an sql example: CREATE OR REPLACE FUNCTION get_levels_test (maxlevel int) RETURNS SETOF…
0
votes
2 answers

Using a row as a table in a query within a function PLpgSQL

I am trying to write a plpgsql function that loops through a table. On each loop, it pulls a row from the table, stores it in a record, then uses that record in the join clause of a query. Here is my code: CREATE OR REPLACE FUNCTION "testfncjh2"…
Harmonic4352
  • 43
  • 2
  • 6
0
votes
2 answers

Greenplum 4.3 doesn't support this 'USING' grammar

EXECUTE 'INSERT INTO ' || tablename_2 || ' VALUES (($1).*)' USING NEW ; Greenplum (based on Postgres 8.2) doesn't support this 'using' grammar, how to do this operator in Greenplum 4.3 Error info: ERROR: syntax error at or near "USING" LINE 1:…
0
votes
0 answers

increment backup in postgresql

Am using postgres 8.2 & and i want take incremental backup using WAL Method, i just take full backup like -000000010000000000000023.00000020.backup.done Suppose that once backup will done, after that there were some DML perform in my database and…
0
votes
0 answers

Modify COALESCE function to consider two adjacent values for the result in Greenplum

I'm currently using the COALESCE function to grab the first NOT NULL value from a list of fields. Example: COALESCE(header_to_node_13.subsetname, header_to_node_12.subsetname, header_to_node_11.subsetname, header_to_node_10.subsetname, …
user3329160
  • 165
  • 2
  • 13