Questions tagged [postgresql-9.4]

PostgreSQL version 9.4

PostgreSQL 9.4 is no longer supported and the product is EOL.

Specifically for PostgreSQL version 9.4

See the PostgreSQL tag for more info.

497 questions
27
votes
1 answer

How do I split a long PL/pgSQL line of code over multiple lines?

Is there a way to split a long line of PL/pgSQL code over multiple lines? My context is a trigger function where I log inserts into a table as per: INSERT INTO insert_log (log_time, description) VALUES ( now() , 'A description. Made up of 3…
dw8547
  • 937
  • 3
  • 10
  • 24
7
votes
1 answer

Is PostgreSQL JSONB @> operator equal to ->''=?

Is the jsonb_column @> '{"key":value}'::jsonb operator equal to jsonb_column->'key' = value? in terms of result, performance, and indexes that will be used?
Kokizzu
  • 1,363
  • 6
  • 17
  • 34
4
votes
1 answer

Compare the tablespace concept between Postgres and Oracle

When I create a table, it is placed in a default tablespace such as "USERS", unless I specify a user created tablespace, say, MyTableSpace. For example, create table test_tab( name varchar2(100), photo BLOB, text CLOB ) tablespace "USERS" …
scott
  • 71
  • 2
  • 6
4
votes
1 answer

How to add function to particular column in while creating table in Postgres?

I want to add a function to particular column while creating a table in PostgreSQL. After creating table, it has to generate auto generated id when we insert values into to the table.
haider
  • 55
  • 1
  • 4
3
votes
0 answers

INSERT INTO with RETURNING clause: return undefined columns?

Breaking it down to it's most simplest form... Is it possible to use INSERT INTO with a RETURNING clause to capture a non-existing column alongside the output? test=# \d x Table "public.x" Column | Type | Modifiers…
Jordan Arsenault
  • 355
  • 1
  • 3
  • 12
2
votes
0 answers

Cannot Create Extension vacuumlo postgresql 9.4

I tried to CREATE EXTENSION vacuumlo, but it fails with the following message: "/usr/pgsql-9.4/share/extension/vacuumlo.control": no such file or directory. I can see other .sql and .control files in that directory, and I was able to CREATE…
TheSQLGuru
  • 69
  • 6
1
vote
1 answer

move postgresql 9.4 cluster to new server

I have a redmine postgresql folder backup (no dump) from postgresql 9.4 and want to move it to a new server with debian 10 (buster) with postgres 11. On my debian buster server I tried to get this old database running, so I installed the old…
rubo77
  • 816
  • 2
  • 13
  • 24
1
vote
0 answers

PostgreSQL v9.4, ERROR: must be owner of database test_db

I'm a new PostgreSQL admin. We have PostgreSQL v9.4.1 installed on a Linux server (Scientific Linux release 6.6). I'm getting the following error in my diagnostic log: 2016-07-10 02:54:12 EDT [4415]: [6-1] db=test_db,user=test_user ERROR: must be…
K. Hilbert
  • 21
  • 3
1
vote
1 answer

Using postgres with logstash - log filename is causing issues

I'm having some trouble forwarding postgres logs to logstash. Normally it's pretty easy to do, but the problem with postgres is that the current logfile has the current date in the filename, so the name changes every day, making it very difficult to…
Whitewind617
  • 131
  • 4
1
vote
1 answer

WAL Streaming Failure PostgreSQL 9.4

I'm trying to setup streaming replication but I'm stuck, please help! I followed the steps in https://wiki.postgresql.org/wiki/Streaming_Replication On Master I have (postgresql.conf) archive_mode = on wal_level = archive max_wal_senders =…
lamvann
  • 11
  • 1
  • 4
0
votes
1 answer

How to perform count(), count(distinct) in the same output using POSTGRESQL

I am trying to perform both count(distinct(keyword)) and count(keyword) from same tables. Here are the two queries. Query-1 SELECT t1.count(distinct(keyword)) from keyword t1, sent t2,tweets t3,users t4 WHERE…
bunny sunny
  • 113
  • 3
0
votes
1 answer

ERROR: relation "codepool_codepoolseq_seq" does not exist SQL state: 42P01

Below is my script but I keep getting an error. -- Table: public.codepool -- DROP TABLE public.codepool; CREATE TABLE public.codepool ( codepoolseq bigint NOT NULL DEFAULT nextval('codepool_codepoolseq_seq'::regclass), codenumber…
Craig Gordon
  • 9
  • 1
  • 3
0
votes
1 answer

setting timing on not getting time in log

I have made the sql query like: \timing on \echo truncate table raw.decrement_m7_temp; copy raw.decrement_m7_temp FROM PROGRAM 'zcat /path/filename' with(format csv,delimiter ',',header); delete from raw.decrement_m7_temp where decrement_dt ilike…
s.kumar
  • 61
  • 1
  • 4