Reputation
18,944
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
4 36 67
Newest
 Enlightened
Impact
~1.4m people reached

Jan
20
comment PostgreSQL - Are CREATE FUNCTION and DROP FUNCTION locking when used inside different transactions?
Yes of course the other transaction will wait. (Nearly) Every DDL statement takes an exclusive lock on the object being modified (dropped, created): postgresql.org/docs/current/static/explicit-locking.html
Jan
20
comment Postgresql cannot drop trigger
This is not a Postgres problem. It is a problem with that alembic thing.
Jan
20
comment PostgreSQL - Are CREATE FUNCTION and DROP FUNCTION locking when used inside different transactions?
Drop function will not lock any table - as no table is involved. What exactly do you mean "are table-locking". You will need to show us your complete code.
Jan
20
comment Does JSONB column type in export look identical to JSON?
With a plain text format you'll get the JSON as - well - plain text. With a custom format your whole dump file is a binary compressed archive. This is all documented in the manual
Jan
18
comment CREATE as SELECT with CONSTRAINT?
Very good point
Jan
18
comment Making data fetching faster on VIEW
Please add the execution plan (formatted text please, no screen shots)
Jan
17
comment should I denormalize for user profiles?
Can you show us your current data model? I don't really see why the retrieval of a single user profile requires more than one query. How is your "profile" stored in the database?
Jan
17
comment Dynamic form builder database optimization Postgresql
wiki.postgresql.org/wiki/Slow_Query_Questions
Jan
17
comment How can sqlplus knows where ORACLE_SID point?
docs.oracle.com/database/121/SQPUG/ch_three.htm#SQPUG352
Jan
16
comment How can sqlplus knows where ORACLE_SID point?
I think ORACLE_SID only works for connections to a locally running Oracle instance.
Jan
16
comment Which executes first? Trigger or rule?
What is "poziom" = (SELECT poziom(NEW."kto")) supposed to do? Do you also have a function named poziom (in addition to the column?). And what is the function konto_zwrocone() doing?
Jan
12
comment Performance issue using view vs. direct statement
yes: postgresql.org/docs/current/static/sql-select.html#SQL-DISTINCT
Jan
12
comment Why do string functions on SQL based database servers start at position 1 instead of 0?
I find zero-based indexing extremely strange. After all this is how I count in real life. A word starts with the first character, not the "zeroed" character.
Jan
12
comment Performance issue using view vs. direct statement
distinct on() is usually faster on Postgres than the equivalent solution using a window function.
Jan
12
comment Performance issue using view vs. direct statement
Please add the execution plans using explain (analyze, verbose) for both statements.
Jan
12
comment Why can't I restore the DB from an SQL dump in PostgreSQL 9.4 (problem with dblink)?
Maybe the dblink module was installed into a different schema in the source database. Can you show us the complete statement that fails from the input file? Also check the source file for set search_path or set schema statements prior to the failing statement
Jan
12
comment PostgreSQL Recursive Descendant Depth
So you want to update the table with the result of your recursive CTE?
Jan
11
comment Will this SQL snippet REINDEX my GIN index? Why is it renaming an old index onto another?
Re-creating an index will only reduce index bloat, never table bloat. The renaming is not really necessary unless you rely on that index name somewhere in your application.
Jan
11
comment Convert BLOB in an Oracle into the Equivalent of Postgres
@mustaccio: the OID part refers to using "large objects". The actual value is not stored in that column. The column simply links to data stored in pg_largeobject
Jan
11
comment DayOfYear as per Indian fiscal year
Added sql-server tag based on the accepted answer