Quantcast
Channel: Question and Answer » postgresql
Browsing all 1138 articles
Browse latest View live

How do I model the database for an application containing canvases which are...

How should I model my database if I wanted to have this functionality: I want to be able to create a canvas which has many building blocks (they are something like it’s sections). There are many types...

View Article


PostgreSQL index array of int4range using GIN / GIST – custom operator class

Here is my table: CREATE TABLE mytable ( id INT NOT NULL PRIMARY KEY, val int4range[] ); I want to index the val column: CREATE INDEX ix_mytable_val ON mytable USING GIN (INT4RANGE(val, '[]')); //...

View Article


PostGIS, distance between two users

I have a simple table (location_test) with three column (name, geom , jid). geom is a geometry column with SRID 27700. I set the user’s geometry position with: UPDATE location_test SET geom =...

View Article

Syntax error when trying to import database from two PostgreSQL databases

Following on from this prior question, I’m trying to export a database from one server and put it on another using phpPgAdmin. My process is like this: select the database in server 1 and hit the...

View Article

Why does PostgreSQL require its own user/group for installation?

When installing PostgreSQL via MacPorts (and I assume via other means too), a postgres:postgres user/group is created. Are there any reasons why this user/group is needed?

View Article


PostgreSQL – Date added row metadata

Is there a means of differentiating rows added after a certain date without explicitly storing that information as a column item? I working with a database that is constantly being filled with...

View Article

Postgres locale error

I have a Postgres database hosted on Digital River, on Ubuntu, and followed these instructions to install: But something is wrong with the locale settings and I cannot work out how to fix it. When I...

View Article

Which all system parameters to be considered for standard Vacuum process

We want to run standard vacuum process on our production database which is over 100 GB and have millions of dead tuples. Can anyone suggest what system parameters we need to keep in mind for setting...

View Article


PostgreSQL cannot start after replacing contents inside its Data folder

When recovering the Postgresql database from a hacked Ubuntu 12.04 server, I copied the data directory to another location, reinstalled the OS and PostgreSQL, stopped PostgreSQL service, removed the...

View Article


PostgreSQL stored procedure to return rows or empty set

I have stored procedure, which RETURNS SETOF ct_custom_type and inside I do RETURN QUERY EXECUTE 'some dynamic query' And I want to do this: If this ‘dynamic query’ returns >= 10 rows, I want to...

View Article

Constraint on Composite Type

How can I create a constraint on a sub-field of composite type? Pseudocode create type axis( major_axis float, minor_axis float, angle float constraint angle_constraint check(angle between -90 and 90)...

View Article

confused over encoding/locale in postgresql

I am a little confused over the difference between encoding and locale as it pertains to the postgresql database. When initializing the database, you can specify both an encoding and a locale. Correct...

View Article

Which is the best way of working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining, but I have this question: I have a PostGIS database with (obviously) GIS data, If I want to make statistical...

View Article


I Can't Add More Layers on My WebGIS. Why?

I want to add layer on my web-mapping, I have this code in “pmapper_loc.map” LAYER NAME 'eastjv' TYPE POLYGON TEMPLATE "void" CONNECTIONTYPE postgis CONNECTION "host=localhost user=postgres...

View Article

Having a PostgreSQL database exposed to the internet

I’ve seen on DBA and other sites that exposing a database to the Internet is a particularly bad idea, but I noticed that PostgreSQL has SSL-certificate-only authentication. Does this make it any safer...

View Article


finding the path to start postgres

On my local machine, when I want to start the postgres server (postgres was installed via Homebrew), I do this pg_ctl -D /usr/local/var/postgres -l logfile start I just installed postgres on a ubuntu...

View Article

PostgreSQL difference between VACUUM FULL and CLUSTER

I have a table with 200 GB of size occupied by data and 180 GB of size by the 6 indexes on it. It is 30% bloated, so I want to reclaim unwanted space occupied by it. It is clustered on job_id_idx...

View Article


When does PostgreSQL write logs?

I turned on the configuration parameter log_planner_stats and would like to examine the details in log. But the log file is empty. It seems all the log files are changed at 12:00am of a day. Does...

View Article

Can't connect to my Postgres databases [closed]

*** THIRD AND LAST UPDATE *** Excuse me very much, the error was highly stupid: I modified start.conf and changed it to manual. I thought that it was related to the start of the service at init, not to...

View Article

Postgresql: No data left on drive, how can I wipe it and start over?

I have a system with a non-critical postgres database that was unmonitored and consumed all available space on its drive. The OS is unaffected so I am free to delete files. I would like to just delete...

View Article
Browsing all 1138 articles
Browse latest View live