Tag Info

New answers tagged

1

It actually suffixes the password with the username and then MD5 hash is made out of that, and that hash is then prefixed with 'md5'


1

Whether a password is required or not has nothing to do with pg_shadow and whether a password is actually defined for the user. Yes, I know, that's weird. pg_hba.conf controls the authentication method. If you want to request a password, use md5 authentication. If you want to allow login with no password to anyone, use trust. If you want to require the same ...


1

For Question 1: using md5 auth for local connections is particularly helpful when you have a multi-user machine, or if you might add additional user accounts for friends/family/coworkers/whoever someday. If you are and will remain the only actual user on your system, there is less benefit, but it could still be useful: suppose some bad guy manages to break ...


0

You are using plain text dump and that's why it break on those characters. Try with custom format and use pg_restore for restoring the database. check this tutorial Be aware that you need to copy also user rights or recreate them on new machine related with the database.


2

His response was that it was going to use more resources if it was array instead of text and that I should focus on my programming instead of wasting resources. Evidence? If he's arguing performance against what'd otherwise be a clarity and correctness improvement, the onus is on him to provide evidence. Delimited text is usually the wrong way to do ...


2

Function for a single table Returns all character-type columns of the given table with a count of empty values ('') and whether they are defined NOT NULL. CREATE OR REPLACE FUNCTION f_tbl_empty_status(_tbl regclass) RETURNS TABLE (tbl text, col text, empty_ct bigint, not_null bool) AS $func$ DECLARE -- basic char types, possibly extend with citext, ...


1

The best way to do this is with a CHECK constraint, as you noted, possibly via a DOMAIN, e.g. CREATE DOMAIN nonempty_string AS text CONSTRAINT non_empty CHECK (length(VALUE) > 0); then ALTER existing columns to use the domain. If that's not possible, you will need to query INFORMATION_SCHEMA to find all columns of the target type across all tables, ...


2

According to the true nature of things (as I understand it), I suggest two tables: CREATE TABLE product ( product_id serial PRIMARY KEY , product text NOT NULL -- more attributes of the product ); CREATE TABLE offer ( offer_id serial PRIMARY KEY , product_id int NOT NULL REFERENCES product , price int -- prices in cent , ...


1

The best option is probably to install PostgreSQL 9.1 from http://apt.postgresql.org/ if it's available for your distro/version. If not, you can install a temporary copy of your old Ubuntu version in a VM for recovery purposes - use virtualbox, kvm, etc. Vagrant can make life easier, just grab a prebuilt Ubuntu box from ...



Top 50 recent answers are included