Reputation
11,829
Next tag badge:
686/1000 score
213/200 answers
Badges
7 32 55
Newest
 Revival
Impact
~590k people reached

Dec
8
comment Fill Database With Recursive Factorial Function
Apparently (and not surprisingly), the recursive calls return like the innermost one first, the outermost one last. The call to fact() precedes the put_line().
Dec
7
comment Grouping and Transposing Rows to Columns in PostgreSQL
@Worker the pivot and postgres tags together should give you some good answers on this site.
Dec
7
comment Get max url from PostgreSQL statement
What is the data type of url, in the end?
Dec
4
comment Oracle 11g SYSDBA login
So how does this answer the question? 'But I want to connect as sysdba using a gui tool.'
Dec
3
comment Removing duplicate rows and changing related foreign keys in PostgreSQL
Well, the second one is simpler, true - however, the first one is a better fit for scripting or further (non-human) processing. It cannot get much simpler in this case, I'm afraid. (Also, I don't see why complexity is a problem here.)
Dec
3
comment Removing duplicate rows and changing related foreign keys in PostgreSQL
The beginning of the query and an explanation are missing.
Dec
2
comment Bulk Insert Through Network
Are you sure it's the same error?
Dec
2
comment Cannot open table mysql/innodb_index_stats
There was no upgrade mentioned - do you mean they need to do it first?
Dec
2
comment Postgresql hot standby what happens when Master is down
No. You have to trigger the failover manually. And then shoot down the master so that it cannot come up as a master again - that would lead to some hard to recover disaster situation. All these are quite nicely descibed in the docs: postgresql.org/docs/9.4/static/warm-standby-failover.html
Nov
27
comment Order result by count of common array elements
intarray still has its use cases, this might be one of them. The extension has a few funtions, too, which are very handy.
Nov
26
comment How to convert a MySQL database to PostgreSQL?
Ah, this is funny. Have you realized that the author of the tool has posted an answer, too? ;) Now I did.
Nov
26
comment How to convert a MySQL database to PostgreSQL?
Could you edit your post with a link to this tool, please?
Nov
26
comment PostgreSQL - is it possible to use a plpgsql function in a bash script?
The question was about calling plpgsql from a bash script, but what you show here is about installation - please consider deleting this answer.
Nov
26
comment ERROR: duplicate key value violates unique constraint “repl_stat”
Exactly how did you set up continuous archiving? If you log in as a superuser, you should find something after issuing \d *.replication_statistics in psql.
Nov
26
comment A “best practice” Postgresql function template for ETL processes
I'd say not to open nested blocks - if you add an EXCEPTION clause into it, it basically behaves as a nested transaction, with all the overhead it implicates. I usually advocate catching the errors at the end of the main block. And yes, you can catch classes, by catching the category (in your example, integrity_constraint_violation (23000), always the first item after a class header in postgresql.org/docs/current/static/errcodes-appendix.html)
Nov
25
comment Pass tablename as sql script argument
-c is for specifying a command, but you specify none. I think you mean -v instead. Additionally, ''''||:table::char(52)||'''' is completely incorrect. A table name cannot be quoted this way and the cast does not make sense. Just use :table in its place.
Nov
25
comment Zero downtime copy/restore of a PostgreSQL database
Does 'new data' mean INSERTs only? If not, some sort of logical replication may help you - it won't make the process much simpler, though.
Nov
25
comment A “best practice” Postgresql function template for ETL processes
This should be enough. Catching 'others' might be very expensive, though - if you can, narrow down the error types.
Nov
25
comment Should I stop transaction log backups during a full backup?
Aren't you telling the same thing Alex_L posted a while ago?
Nov
24
comment Discover missing foreign keys and/or indexes
You could use grep -i join :D Seriously, pgbadger could help you finding the typical queries - with some parameters, you may find most of the interesting ones.