Reputation
8,292
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
3 18 43
Newest
 Informed
Impact
~405k people reached

Jun
9
comment How to check/know the highest run queries
Out of curiosity, how big is big? Also, by 'highest run' do you mean the most often run or the cumulatively most expensive queries? And, with a simple view, you don't spare anything in this regard.
Jun
6
comment How to prevent a PostgreSQL trigger from being fired by another trigger?
It sounds like an error in the trigger logic. Could you show the trigger procedure that throws it?
Jun
5
comment Sync offline database with online
Check Londiste. If the different local changes affect distinct sets of rows, then it is relatively easy.
Jun
4
comment What is the best way to clear couple of tables each night at specific hour in Postgres SQL?
If you want to empty the tables, you may want to use TRUNCATE instead.
Jun
4
comment Foreign table not using index
I think that is a different issue. But how often do you need to create this foreign table? Isn't it a one-time operation?
Jun
4
comment Foreign table not using index
You can edit your question with those. Anyway, there is only a half millisecond difference between the two - is there a reason (say, a huge dataset in the future) why you are worried about it?
Jun
4
comment Foreign table not using index
Here you see a foreign scan - I think it does not tell you if it uses an index or not. I would expect it does and you lose the time on network latency or elsewhere. Please add the output of EXPLAIN ANALYZE for both queries.
Jun
4
comment Ensure order when select two rows using two identifiers on the same column
Why do you need this? Anyway, at least in PostgreSQL, SELECT * FROM teams WHERE name = $1 UNION ALL SELECT * FROM teams WHERE name = $2; would return the rows in this order, I believe.
Jun
4
comment Postgresql :i want tro truncate column
Do you want to change the column type, or just get back the shortened text in a query?
Jun
3
comment What is the purpose of the keyword “||” in PostgreSQL?
... and in PostgreSQL, concatenate tsvectors, OR tsquerys together, array-to-array concatenation, element-to-array concatenation and array-to-element concatenation.
Jun
3
comment What is the purpose of the keyword “||” in PostgreSQL?
postgresql.org/docs/9.4/static/index.html - worth reading. This you will find in several sections of 9. Functions and Operators
Jun
3
comment is it possible to run postgres with no WAL files being produced?
There is no way for doing that. WAL stands for Write Ahead Log, and this is the mechanism how the data and their changes are persisted - the DB cannot live without it. Read postgresql.org/docs/current/static/wal-intro.html for more details. You will have to add more disk space and/or rethink the batch job to produce fewer changes.
Jun
3
comment Postgresql list all functions associated with table and column
What is a function of a table? I haven't heard about such a thing until now. Anyway, you can add a condition to the WHERE clause to match the column name, too. Finally, If I'm not mistaken, this is basically the same problem that you've asked before: dba.stackexchange.com/questions/103126/…
Jun
3
comment Drop primary key without dropping an index
@xchg You cannot run CREATE INDEX CONCURRENTLY in a transaction - it would defeat the idea behind using CONCURRENTLY, namely avoid blocking.
Jun
2
comment postgresql view all tables with specific FK
I've just told you above where and how to find that query...
Jun
2
comment Access mysql database from another system using LAN (Wired or Wireless)
So, this is no PostgreSQL question, please retag. Also, the message clearly states that you have to allow the connection from SWAPNIL-PC.
Jun
2
comment postgresql view all tables with specific FK
In psql, issue the command \set ECHO_HIDDEN on and then look at the output of \d on this table. There will be a bunch of queries above the usual output, pick the one that gets the entries in the Referenced by: section.
Jun
2
comment Check for duplicates in column and determine which row to keep
Could you add some examples? I'm afraid I don't fully understand the problem.
Jun
1
comment PostgreSQL force upper case for all data
CHECK (upper(your_column) = your_column) - but you have to define this for every text column.
Jun
1
comment postgresql how can i get list of trigger which are fired when function X is working?
You have to match the definition of function X (which might be tricky, even if there is no dynamic SQL involved, you will have to parse it) to the trigger definitions. These latter can be obtained from pg_trigger and pg_catalog.pg_get_triggerdef(). From these two, the first part is hard, the second one is easy.