Reputation
14,611
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 28 54
Newest
 Yearling
Impact
~856k people reached

Apr
21
comment Can this UPDATE be faster with indexes?
@septerr: the main reason the query is faster is the removal of the implicit cross join you created between line_item and itself through the from line_items part. Read the note in the manual regarding this: postgresql.org/docs/current/static/sql-update.html#AEN85302
Apr
21
comment How to use except but excluding a column from the except clause comparison -psql?
That would be intersect not except but I agree the question is very unclear.
Apr
20
comment postgreSQL hot_standby pg_dump on slave
@Antonio: you need to tell us which error you get. If the standby is configured as a "hot standby". You might want to enable the hot_standby_feedback: postgresql.org/docs/current/static/…
Apr
17
comment Sharing PostgreSQL database on one dual-boot machine without duplication (cross-platform)
Data directories are not compatible between operating systems. This is not going to work
Apr
17
comment Which terms are used to refer a row in database?
Yes, that's true
Apr
17
comment Which terms are used to refer a row in database?
A row is a row. There is no other name for it. Some people use the term "record", but as Joe Celko put it: "Rows are not records; fields are not columns; tables are not files"
Apr
16
comment Generate create table DDL from any arbitrary select query?
Which SQL client are you using? Maybe there is a feature in the client to do that.
Apr
16
comment Unable to create read only user— postgresql 9.4
Did you try to explicitly revoke the create privilege? revoke create on schema public from user1. Btw: your example revoke is invalid and won't run because it's revoke ... from ... not revoke .. to ...
Apr
16
comment PostgreSQL: raise error if planner needs to do an sequence scan
"When is a seq scan a good plan if the table has more than 10M rows" - select customer_id, avg(order_amount) from orders group by customer_id for starters or any query that needs more than approximately 15% of the rows
Apr
16
comment PostgreSQL: raise error if planner needs to do an sequence scan
I agree with Colin. It is a common misconception that a seq scan is a (always) bad thing.
Apr
15
comment Insert date values in a created table
'0000-00-00' is an invalid date. If you don't have a value, then just store NULL. Also: which DBMS are you using?
Apr
15
comment dbms_datapump API exclude statistics during import
@Colin'tHart: actually this answers my question perfectly ;) Works like a charm
Apr
15
comment Call function where argument is a (sub)select statement
I think you need an extra pair of parentheses: SELECT * FROM test_function((SELECT customerid FROM tableX where id = 1))
Apr
15
comment Mathematical equality of two SQL statements
@BuahahaXD: that's not true. select * from foo where id = 4 will most certainly have the same execution plan as select * from foo where id = 2
Apr
14
comment SQL User Permissions for Continuous Integration via TeamCity
Added sql-server tag based on the mentioning of sqlcmd
Apr
14
comment conversion failed when converting the varchar value 'JENNIFER FALCONER
Always add the tag for the DBMS you are using. Postgres, Oracle, ...
Apr
14
comment conversion failed when converting the varchar value 'JENNIFER FALCONER
You mean appearance is a varchar - customer is a table.
Apr
14
comment How can I use PostgreSQL's partial sum tree index (if it even exists)? Do any databases allow for use of such an index?
Details about Postgres' GiST implementation can be found here: postgresql.org/docs/current/static/gist.html to my knowledge Postgres is the only DBMS that allows you to "plug-in" your own index types through an extension.
Apr
14
comment Problem With update column in table
Please tell us which DBMS you are using. Postgres? Oracle?
Apr
13
comment For Postgres, how would I define a custom function to generate primary keys?
Create a function that does what you want, then use create table foo (some_column varchar default my_function());