Reputation
7,763
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
3 18 42
Newest
 Revival
Impact
~351k people reached

Feb
25
comment How to put the results of a query into a variable?
You have changed your question completely... However, a record could take all the values you select in the query.
Feb
25
comment PostgreSQL 9.3.5 database restore error : plpgsql already exists
postgresql.org/docs/9.4/static/release-9-0.html says since 9.0 PL/pgSQL is installed by default. You will have to handle this yourself from your program, I'm afraid. On the other hand, an error that has no effect on the final outcome is no error in my view, meaning your program is already correct in this regard, despite seeing that message.
Feb
24
comment How to speed up query which is using <@> operator?
@user606521 OK, but you ORM users should state this before we DBAs jump on it ;)
Feb
24
comment How to speed up query which is using <@> operator?
Are you using a keyword (that is exactly 1 character shorter than the table name and altogether unnecessary) as a table alias out of masochism? ;) At the same time, is a query running for a whopping 32 ms really too slow?
Feb
24
comment Insert into a specific partition, create if not exists
Yes, it is possible. Write a BEFORE INSERT trigger, for example, that acts on the parent table and redirects all rows to the corresponding partitions, and creates the partitions on demand. For bulk inserts this may be very slow, though.
Feb
23
comment query to find all dblink()
You can get all open dblink connections using dblink-get-connections. Those that are not used can only be found by examining your function code, especially if you have pl/pgsql functions (like triggers), too.
Feb
23
comment Use a set database schema or EAV design?
Please ask this as a separate question.
Feb
23
comment Select rows from table where each row refers to a different schema
In order to get a meaningful answer (longer than 'Look into dynamic SQL'), please give an example of how portal tables differ among customers.
Feb
20
comment Postgres installation on MacOSX - problem with psql
I'm not sure how it works on OS X, but on linux, one has to run updatedb before trying to find something new with locate.
Feb
19
comment How can I implement a sequence for each foreign key value?
Let's add to 2/cons that seauences are not designed to produce contiguous numbers. With a rolled back transaction, the number issued will not reappear (unless you reset the sequence, but then the problem in 1/cons/1 comes up).
Feb
19
comment Mysql query giving incorrect values
Data you are starting with? Expected output? Or how else we should know what's wrong here?
Feb
19
comment how can optimize this sql query for being faster than superman
Please replace the explain output with something like you see in the very first example here: dev.mysql.com/doc/refman/5.7/en/explain.html - that would be actually readable.
Feb
18
comment How do I alter my role to be a superuser?
Simply log in as postgres and ALTER ROLE youruser WITH SUPERUSER
Feb
17
comment psql: how to turn off context messages at raise notice
@a_horse_with_no_name's suggestion applies to the contents of the log file. For psql, the equivalent is \set VERBOSITY terse.
Feb
16
comment Renaming a column in a PostgreSQL database table
@Qwerty I'm not sure I understand what you are asking. Otherwise, the column that is referencing a column of another table is shown in the pg_catalog.pg_constraint.conkey column (the number in that array itself referencing pg_attribute). No column name is involved in this.
Feb
16
comment Reducing the size of a PostgreSQL Database, utilizing a process other than full VACUUM
With pg_dump you only dump a single DB (unlike with pg_dumpall in the linked post). With dumping, DROP DATABASE and restoring this DB, the other ones should not be affected at all.
Feb
10
comment Storing floating point values for various units of measurement (kg, ml, mm, pl)
The type numeric can store numbers with a very large number of digits and perform calculations exactly. Compare this to The data types real and double precision are inexact, variable-precision numeric types.
Feb
10
comment Storing floating point values for various units of measurement (kg, ml, mm, pl)
numeric is not floating point! postgresql.org/docs/9.4/static/…
Feb
10
comment How can one optimize a query involving a sort and a LIKE?
Ugh, sorry, the identifier mismatch is my fault, I tried to remove all the double quotes and other noise but did only half of the work. I rolled my change back.
Feb
9
comment How can one optimize a query involving a sort and a LIKE?
How will this help with the issue?