Reputation
19,930
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
4 37 70
Impact
~1.5m people reached

Jun
9
comment How can we configure the Streaming Replication(master-slave) on single SAN storage in PostgreSQL?
You configure it the same way as any other replication configuration. Have two Postgres servers where the masters streams the WAL files to the slave - you just need to make sure that master and slave use different data directories.
Jun
8
comment Speed up creation of Postgres partial index
"Autovacuums are turned OFF" - why? That is a really bad idea. This prevents the collecting of statistics and thus will yield bad query plans
Jun
8
comment Count of distinct values of a table using sql
@Colin'tHart: that's why I said the question should be tagged with the appropriate DBMS.
Jun
8
comment Count of distinct values of a table using sql
Although not relevant for such a basic question, you should always add the tag for your DBMS (postgresql, oracle, ...)
Jun
7
comment the cache hit rate using pg_statio_user_tables
First: a ration of 0.44 is 44% - but I would think the ratio should be calculated: using sum(heap_blks_hit) / sum(heap_blks_read)
Jun
5
comment Cannot rename database (the user in --username is the owner)
Which is exactly what the error message told you...
Jun
3
comment is it possible to run postgres with no WAL files being produced?
@davegreen100: if you are concerned about the WAL files, then switch to streaming replication and turn off WAL archiving. Switching all tables to unlogged will effectively exclude them from replication - if that is acceptable you apparently don't need the standby in the first place
Jun
3
comment What is the purpose of the keyword “||” in PostgreSQL?
It's the standard SQL operator to concatenate strings.
Jun
3
comment how to aggregate time and data correspondingly using SQL?
The first two columns look like time columns - you can't add two time values (what is the sum of 3 O'clock and 6 O'clock?). It seems you rather want an interval there - if you change your table definition then you can actually add the values. Given the current sample data it's simply not possible.
Jun
2
comment Restoring the superuser account on the postgres server
Interesting. I wasn't aware that pg_ctl can not start Postgres in single user mode. -o "--single" does not seem to work.
Jun
2
comment Restoring the superuser account on the postgres server
If you use pg_ctl instead of postgres you can do all that using an administrator account as well, because pg_ctl will make sure that the additional privileges are "dropped" before running Postgres
Jun
2
comment Restoring the superuser account on the postgres server
Since 9.x it is no longer necessary to create a dedicated Windows user to run Postgres.
Jun
2
comment Which query performs better when searching a row where a column has maximum?
Look at the execution plan (using explain analyze) and you will know. Btw: your two statements are not equivalent. The first one will return multiple rows if multiple person are the same age, the second one will not.
Jun
1
comment Postgresql upgrade issue
Did you disable (or even un-installed) your anti-virus program? These kind of problems often arise because the anti-virus blocks access to the files. If you can't disable the anti-virus, at least exclude the data directories from scanning.
Jun
1
comment Is it acceptable to have circular foreign key references\How to avoid them?
@MaxVernon: the question is not only about SQL Server and there are more DBMS than just Oracle that support deferrable constraints - but as I said: I do agree with Pieter that the design itself is wrong (and his solution makes much more sense)
Jun
1
comment Is it acceptable to have circular foreign key references\How to avoid them?
"If so, how can data be inserted" - depends on the DBMS being used. Postgres, Oracle, SQLite and Apache Derby for example allow deferrable constraints which would make this possible. With other DBMS you are out of luck (But I would still dispute the need for such a constraint in the first place)
Jun
1
comment postgresql double count query
@someone45: ah, sorry. I mixed up the columns.
Jun
1
comment Local Backup from Amazon RDS PostgreSQL database
Can you connect using psql using those parameters?
May
31
comment Is it acceptable to have circular foreign key references\How to avoid them?
"it would be impossible to insert data" - no, it would not be impossible. Just declare the constraints as deferrable. But I do agree: in almost all cases circular references are a bad design.
May
31
comment Postgres one-liner import & export SQL without login & without asked for password
stackoverflow.com/q/6405127/330315