7,521 reputation
31842
bio website
location Berlin, Germany
age 39
visits member for 3 years, 2 months
seen 2 hours ago

May
30
comment PostgreSQL insert into table (not origin) based on a condition on fields on different tables
So [empty] means NULL or ''?
May
30
comment Algorithm for finding the longest prefix
the prefix has to be at the beginning, right?
May
30
comment Algorithm for finding the longest prefix
I am not really sure if code in the first table is the same as prefix later. Could you please clarify it? And some fixing of the example data and desired output (so that it is easier to follow your problem) will be also welcome.
May
30
comment Change built-in default privileges in PostgreSQL?
@MichałRus Please see my edit above.
May
30
comment Query result with X rows discarded
+1 - in my view it is typically the COMMIT; which makes the previous results discarded. Another posibility is to define temporary table without ON COMMIT DROP - so it is still there after committing and can be queried.
May
29
comment Repairing Broken Binary Replication in PostgreSQL 9.0
I would say that with the current setup you have no chance, to push 300 GB over that line takes more that 100 hours... Furthermore, if your WAL segments are generated more frequently than every 20 seconds, the connection simply can't keep up.
May
28
comment When does PostgreSQL write logs?
:) the grey background and typewriter font are used to reflect that the test is either a piece of code or a command. less is the linux less command.
May
28
comment Is using SUM() twice suboptimal?
@ypercube well, we have some differences from the standard already, don't we? :)
May
28
comment Is using SUM() twice suboptimal?
@BartFriederichs well, many people complain alongside these lines (I had complained as well until I did not get used to it...) It is not executed twice and probably could be done by using an alias in HAVING (and then pulling the column definition from the SELECT clause) - for some reason they just don't do that.
May
28
comment Is using SUM() twice suboptimal?
... this is why you can't just reference the aggregated column in the HAVING clause - but, to my understanding, internally this is rather done the other way around.
May
28
comment Is using SUM() twice suboptimal?
I won't answer this as there is a nice, concise explanation here: " In case you're wondering why you can't refer to the SELECT aliases later in the query, like in the WHERE clause, it's all to do with order of evaluation. SQL isn't evaluated in the order it's written. The SELECT-list is actually evaluated almost last, and its contents effectively don't exist yet when HAVING etc are processed. This becomes important when the select-list includes functions with side-effects [...]"
May
27
comment Configuring PostgreSQL for read performance
Is this your typical query? Why is TimestampIndex included in the index? How many different KeyTag values do you have? And what does \di+ PK_AnalogTransition outputs (run from psql)?
May
24
comment Join on different types
... or you may set up an index on second_table.id::integer as well
May
23
comment Server doesn't listen
One first step of troubleshooting could be what I described above. So do you reach the DB from the host machine of the VM?
May
23
comment Server doesn't listen
Adding to Mat: do you reach the DB from the host machine of the VM?
May
21
comment pg_restore and psql asks password for restoring dump file
Do you have a database user? One of the differences between the two commands is -U postgres
May
20
comment Postgresql - how to drop a trigger
But how is this connected to the syntax error?
May
19
comment Oracle UPDATE followed by SELECT in LinqPad
@Baodad definitely yes.
May
17
comment psql coloured prompt misbehaving
I have included the versions and findings, could you please check them?
May
17
comment TokuDB/InnoDB Question
Why would you add just another unique key to an already existing one? Is gameId subject to changes?