Posts in 2021
-
Most votes on python questions 2
May 01, 2021 in FAQ
Most votes on python questions 2. #11 Difference between staticmethod and classmethod #12 Understanding slice notation #13 Finding the index of an item in a list #14 Does Python have a string 'contains' substring method? #15 Iterating over dictionaries using 'for' loops #16 How do I list all files of a directory? #17 How do I sort a dictionary by value? #18 Using global variables in a function #19 How do I check if a list is empty? #20 How to get the current time in Python
Read all the top votes questions and answers in a single page. #11: Difference between staticmethod and classmethod (Score: 3922) Created: 2008-09-25 Last updated: 2019-11-27 Tags: python, oop, methods, python-decorators What is the difference …
-
Most votes on python questions 10
May 01, 2021 in FAQ
Most votes on python questions 10. #91 How to measure elapsed time in Python? #92 How to print to stderr in Python? #93 Why can't Python parse this JSON data? #94 Extracting extension from filename in Python #95 Random string generation with upper case letters and digits #96 Use of *args and **kwargs #97 Proper way to declare custom exceptions in modern Python? #98 Converting integer to string in Python #99 What's the canonical way to check for type in Python? #100 What is the meaning of single and double underscore before an object name?
Read all the top votes questions and answers in a single page. #91: How to measure elapsed time in Python? (Score: 1495) Created: 2011-09-10 Last updated: 2020-06-01 Tags: python, performance, measure, timeit What I want is to start counting time …
-
Most votes on python questions 1
May 01, 2021 in FAQ
Most votes on python questions 1. #1 What does the "yield" keyword do? #2 What does if name == "main": do? #3 Does Python have a ternary conditional operator? #4 What are metaclasses in Python? #5 How do I check whether a file exists without exceptions? #6 How do I merge two dictionaries in a single expression (taking union of dictionaries)? #7 How to execute a program or call a system command from Python #8 How can I safely create a nested directory? #9 Accessing the index in 'for' loops? #10 How to make a flat list out of a list of lists?
Read all the top votes questions and answers in a single page. #1: What does the "yield" keyword do? (Score: 11117) Created: 2008-10-23 Last updated: 2020-02-26 Tags: python, iterator, generator, yield, coroutine What is the use of the …
-
Most votes on postgresql questions 9
May 01, 2021 in FAQ
Most votes on postgresql questions 9. #81 Using psql how do I list extensions installed in a database? #82 psql: could not connect to server: No such file or directory (Mac OS X) #83 Create unique constraint with null columns #84 How to set auto increment primary key in PostgreSQL? #85 What is the PostgreSQL equivalent for ISNULL() #86 What's the fastest way to do a bulk insert into Postgres? #87 How to persist data in a dockerized postgres database using volumes #88 How do I modify fields inside the new PostgreSQL JSON datatype? #89 Postgresql GROUP_CONCAT equivalent? #90 How to check if a particular service is running on Ubuntu
Read all the top votes questions and answers in a single page. #81: Using psql how do I list extensions installed in a database? (Score: 282) Created: 2014-02-15 Last updated: 2018-05-04 Tags: postgresql, psql, postgresql-extensions How do I list all …
-
Most votes on postgresql questions 8
May 01, 2021 in FAQ
Most votes on postgresql questions 8. #71 How to UPSERT (MERGE, INSERT … ON DUPLICATE UPDATE) in PostgreSQL? #72 How to declare a variable in a PostgreSQL query #73 How to install PostgreSQL's pg gem on Ubuntu? #74 How to generate the "create table" sql statement for an existing table in postgreSQL #75 Extract date (yyyy/mm/dd) from a timestamp in PostgreSQL #76 How can I put a database under git (version control)? #77 Connecting to Postgresql in a docker container from outside #78 Postgres - FATAL: database files are incompatible with server #79 Reset auto increment counter in postgres #80 DatabaseError: current transaction is aborted, commands ignored until end of transaction block?
Read all the top votes questions and answers in a single page. #71: How to UPSERT (MERGE, INSERT … ON DUPLICATE UPDATE) in PostgreSQL? (Score: 308) Created: 2013-06-24 Last updated: 2017-05-23 Tags: postgresql, insert-update, upsert, sql-merge …
-
Most votes on postgresql questions 7
May 01, 2021 in FAQ
Most votes on postgresql questions 7. #61 How to pass in password to pg_dump? #62 PostgreSQL: Drop PostgreSQL database through command line #63 Run PostgreSQL queries from the command line #64 What is the format for the PostgreSQL connection string / URL? #65 psql - save results of command to a file #66 Comparison of full text search engine - Lucene, Sphinx, Postgresql, MySQL? #67 Best practices for SQL varchar column length #68 Copy a table from one database to another in Postgres #69 Postgresql: Scripting psql execution with password #70 How to get the top 10 values in postgresql?
Read all the top votes questions and answers in a single page. #61: How to pass in password to pg_dump? (Score: 347) Created: 2010-05-23 Last updated: 2010-05-24 Tags: bash, postgresql, shell, crontab I’m trying to create a cronjob to back up …
-
Most votes on postgresql questions 6
May 01, 2021 in FAQ
Most votes on postgresql questions 6. #51 Where does PostgreSQL store the database? #52 Postgres DB Size Command #53 Best way to select random rows PostgreSQL #54 Postgres and Indexes on Foreign Keys and Primary Keys #55 Permission denied for relation #56 Alternate output format for psql #57 updating table rows in postgres using subquery #58 Restore a postgres backup file using the command line? #59 PostgreSQL function for last inserted ID #60 Can't subtract offset-naive and offset-aware datetimes
Read all the top votes questions and answers in a single page. #51: Where does PostgreSQL store the database? (Score: 383) Created: 2009-07-16 Last updated: 2013-02-04 Tags: postgresql Where are the files for a PostgreSQL database stored? #51 Best …
-
Most votes on postgresql questions 5
May 01, 2021 in FAQ
Most votes on postgresql questions 5. #41 How to select the nth row in a SQL database table? #42 "use database_name" command in PostgreSQL #43 Kill a postgresql session/connection #44 How do I specify a password to 'psql' non-interactively? #45 PostgreSQL: How to make "case-insensitive" query #46 How to log PostgreSQL queries? #47 psql: FATAL: Ident authentication failed for user "postgres" #48 Explanation of JSONB introduced by PostgreSQL #49 How to concatenate strings of a string field in a PostgreSQL 'group by' query? #50 List tables in a PostgreSQL schema
Read all the top votes questions and answers in a single page. #41: How to select the nth row in a SQL database table? (Score: 429) Created: 2008-08-19 Last updated: 2019-07-19 Tags: mysql, sql, database, oracle, postgresql I’m interested in …
-
Most votes on postgresql questions 4
May 01, 2021 in FAQ
Most votes on postgresql questions 4. #31 psql: FATAL: role "postgres" does not exist #32 How do you create a read-only user in PostgreSQL? #33
pg_tblspc
missing after installation of latest version of OS X (Yosemite or El Capitan) #34 Where are my postgres *.conf files? #35 Postgres: INSERT if does not exist already #36 How do I (or can I) SELECT DISTINCT on multiple columns? #37 PostgreSQL: Modify OWNER on all tables simultaneously in PostgreSQL #38 How do you find the row count for all your tables in Postgres #39 Generating a UUID in Postgres for Insert statement? #40 How to export table as CSV with headings on Postgresql?Read all the top votes questions and answers in a single page. #31: psql: FATAL: role "postgres" does not exist (Score: 484) Created: 2013-03-08 Last updated: 2015-07-18 Tags: macos, postgresql, terminal I’m a postgres novice. I …
-
Most votes on postgresql questions 3
May 01, 2021 in FAQ
Most votes on postgresql questions 3. #21 PostgreSQL Autoincrement #22 Run a PostgreSQL .sql file using command line arguments #23 How to reset postgres' primary key sequence when it falls out of sync? #24 What is this Javascript "require"? #25 How to do an update + join in PostgreSQL? #26 Postgresql: password authentication failed for user "postgres" #27 Copying PostgreSQL database to another server #28 Import SQL dump into PostgreSQL database #29 Insert text with single quotes in PostgreSQL #30 Postgres could not connect to server
Read all the top votes questions and answers in a single page. #21: PostgreSQL Autoincrement (Score: 624) Created: 2009-04-24 Last updated: 2015-01-05 Tags: postgresql, auto-increment I’m switching from MySQL to PostgreSQL and was wondering how …