I went by the example from the docu which went fine:
select * from json_populate_record(null::x, '{"a":1,"b":2}')
But my self-constructed JSON simplified similar to this did not work :-(
-- p_some_num of type int
select * from json_populate_record(…
Currently my application is running over 2 dbs one is snapshotDB one is evercamDB. In snapshotDB we are saving records now it want to retrieve them , currently am using this query
select camera_id,count(*) as snapshot_count
from snapshots
where…
I have 2 tables:
Organization (2.500.000 rows)
City (35.000 rows)
'Organization' has 'city_id' set as foreign key to 'cities'.'id':
Organization:
ALTER TABLE public.organization
ADD CONSTRAINT organization_pkey1 PRIMARY KEY(id);
ALTER TABLE…
I have a problem when I want to initialize a folder as a data folder:
postgres@ccruzado-test01:~$ /usr/lib/postgresql/9.3/bin/initdb -D /datadrive/postgresql/
The files belonging to this database system will be owned by user "postgres".
This user…
I am running a local Postgres 9.3 in a docker container with a temporary database that is used for some file import operations.
The basic scenario is:
Load files into input tables
INSERT from a SELECT into the output tables (transform)
Read the…
I have a table with lots of default values, and want to store very common values as NULL to save space, without forcing my SQL statements or application logic to become overburdened with conditionals.
Ideally, I would like this equivalent of an…
I want to create this table, but i can’t,
Look this error.
CREATE TABLE ATTR(
window character varying(64) NOT NULL
);
ERROR: syntax error at or near "window"
LINE 2: window character varying(64) NOT NULL
I have only recently delved into the depths of PostgreSQL and have finally hit a snag. There are 3 tables, Notes, Tags, and Notes_Tags (Many to Many). Some Notes do not contain tags, but still need to be displayed. Maybe there is something that I…
I understand that PostgreSQL will store large fields in a separate storage space automatically. When this occurs, is there anything stored per row for that field in the table? A reference or hint of some kind?
I have one doubt on master to slave replication in streaming replication in postgresql. I confgured ONE Master and One Slave with streaming replication in my system If Master fails slave act as a master then it is fine.
My Question:
1) who will be…
All I have is a PostgreSQL table that has a JSON column called agents.
See below:
SELECT agents FROM cnms_rosters;
Result:
agents
------------------
[1,13,3,16,15]
[12,13,14,15,15]
[11,73,55,16,44]
(3 rows)
This column contains the…
Postgresql stores boolean value TRUE or FALSE, while I am passing 1 or 0. And I want to store as 1 or 0 instead of TRUE or FALSE.
Can anyone help me on this please?
I need to run a huge migration script on multiple schemas on PostgreSQL 9.3 server. I want output to be in a .txt format if this failed on any schema. Would you be able to help me on this?
Details:
All schemas are of similar structure and I have the…