Reputation
14,182
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 25 54
Newest
 Enlightened
Impact
~800k people reached

Apr
14
comment creating BTREE index in oracle with clause
You can't create an index "on the fly like that". And "Considering WITH clause as a table" doesn't make sense at all. A common table expression (aka "WITH clause") is not a table.
Apr
14
comment Problem With update column in table
Please tell us which DBMS you are using. Postgres? Oracle?
Apr
13
comment udf to encode strings works in psql but not in python
You should use select platform.encode_sig('" + sig + "'); for scalar functions. select * from ... is for functions returning a result set (i.e. multiple rows)
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());
Apr
13
comment In Postgres, what is the relationship between a SEQUENCE and a SERIAL?
The link to the manual that you posted explains that in detail
Apr
13
comment Transactional DDL workflow for MySQL
You can always upgrade to Postgres - it does support transactional DDL (SCNR).
Apr
13
comment Questions on joining tables
The first one is an outdated way to write an inner join. This is the syntax as it was defined in the SQL standard back in 89. A later standard then introduced the explicit JOIN operator. Don't use the implicit one any more
Apr
13
comment Questions on joining tables
There is no "cross join" in the first example. It's an outdated way of writing a JOIN which was specified in the SQL 89 standard.
Apr
13
comment What's the difference between a using partitioned table and using partial indexes based on the partition key?
wiki.postgresql.org/wiki/Slow_Query_Questions
Apr
13
comment Why is this SQL statement giving me an error
Which DBMS are you using? Postgres? Oracle?
Apr
13
comment Can a slow SELECT statement in READ COMMITTED isolation level read content from concurrent committed UPDATE?
You should add which DBMS you are using (Postgres, Oracle, ...). But in general the DBMS should present a consistent view of the data at the point when the statement started. But not all DBMS actually do that.
Apr
13
comment Oracle: guaranteeing unmodified database state with queries?
With 12c, WITH can include a procedure definition, so it won't be safe either: docs.oracle.com/database/121/SQLRF/…
Apr
13
comment Oracle: guaranteeing unmodified database state with queries?
Ah, right. I wasn't thinking of autonomous transactions.
Apr
13
comment Transaction Management
Which DBMS are you talking about? Oracle? Postgres?
Apr
12
comment Oracle: guaranteeing unmodified database state with queries?
I don't think you can call a function in a SELECT statement that changes the database.
Apr
12
comment Building a database in Postgres in real life - psql cli, .sql script files, gui?
Stay away from GUIs for any work that should go into production. Everything you do, should be done through SQL scripts. Those scripts then have to be stored in a version control system (Subversion, Git). There are also tools like Liquibase and Flyway which can help in manage schema migrations.
Apr
11
comment Query across schemas in PostgreSQL
The number of schemas is irrelevant for the performance of a single query. A query accessing table from many schemas is not slower than the same query accessing tables from a single schema. As it stands your question is impossible to answer.
Apr
11
comment Query across schemas in PostgreSQL
wiki.postgresql.org/wiki/Slow_Query_Questions
Apr
11
comment Simple join in postgresql
explicit joins have nothing to do with optimization or performance. They are about coding style and robustness. With implicit joins it's very easy to forget the join condition and create a cross join without intending it. This is not possible with an explicit JOIN. Do get used to it even for only two tables.
Apr
11
comment Simple join in postgresql
While I agree that using explicit joins is better, the example shown does not create a cartesian product because of the old-fashioned implicit joins in the where clause