New answers tagged psql
I found this answer: http://stackoverflow.com/questions/10763143/in-rails-couldnt-create-database-for-adapter-postgresql And, as simple as it was, it worked for me... ran a $bundle update and it started working again.
I have experience this exact same thing in the past. It usually happens because you have linked psql against an inferior readline-like library. If you are using libedit, use libreadline instead. If you are using libreadline, use a different one. Details depend on your operating system and method of installation.
pgScript is a local script extension of pgAdmin, which you most probably do not want here. pgAdmin is a GUI, not a console application - there is no stdin you could easily use. If you need stdin to stream your content, use psql, which is a console application - with the \copy meta-command of psql. If you have a file (which you obviously do), just use SQL ...
Try the following command: createuser -h 127.0.0.1 -s new_role And if you want to connect your db by using psql interface: psql -h 127.0.0.1 db_name role_name
Table joins are not costly, compared with the alternative, which is incorrect data due to storing the same data in multiple places. Split this into two tables, and if you need to find the most recent price for a set of products you can find the latest price efficiently with something like: select items.item_id , items.name , (select price ...
If you mix the history data in with the current like that in order to speed up queries over a time period, you do so at the expense of slowing down queries for current data. You can add an extra column to explicitly mark the relevant rows as the current prices (and have id+flag as the PK) but that adds extra work to your business logic to both keep it ...
Looks like MB vs MiB, ie decimal SI vs binary megabyte: regress=> SELECT round(25.17*1000*1000 / (1024*1024),1); round ------- 24.0 (1 row) You've done your conversion into megabytes using decimal SI units (MB) not binary megabytes (MiB). Divide by 1024 not by 1000, or use pg_size_pretty: regress=> select pg_size_pretty( 3072 * 8192::bigint ); ...
Top 50 recent answers are included