Thread: getting started

getting started

From
pat knoob
Date:
I've just installed pgsql on debian woody.
when I do "psql connect postgres"

I get "psql: FATAL 1:  IDENT authentication failed for
user "postgres""

this is my hba.conf:

local        all
    ident sameuser
host         all         127.0.0.1     255.0.0.0
    ident sameuser
host         all         0.0.0.0       0.0.0.0
    reject

what do I need to do?

thanx in advance

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

Re: getting started

From
Date:
On Sat, 15 Mar 2003, pat knoob wrote:

> I've just installed pgsql on debian woody.
> when I do "psql connect postgres"
>
> I get "psql: FATAL 1:  IDENT authentication failed for
> user "postgres""
>
> this is my hba.conf:
>
> local        all
>     ident sameuser
> host         all         127.0.0.1     255.0.0.0
>     ident sameuser
> host         all         0.0.0.0       0.0.0.0
>     reject
>
> what do I need to do?

I'm guessing you are trying to connect as some user other
than "postgres".  If you are running as "root", you
need to (temporarily) change your ID to "postgres" and
then try to "psql ...".

 su postgres
 psql ...

Gord


'UNIQUE'

From
Ben Clewett
Date:
Hi,

To describe an optional 1:1 reference I am using the 'UNIQUE' keyword:

    key_foo INT UNIQUE,
    FOREIGN KEY (key_foo) REFERENCES ....

Does 'UNIQUE' allow multiple 'NULL' entries?

Ie:

key_foo
-------
   1
   2
   NULL
   9
   8
   NULL
   4
   NULL

If as I expect, this is not the case, could anybody recommend another
way of forming an optional 1:1 reference?


--------x-------X-------x--------


I have a problem of 'stale' data.  I want to produce combo-box's of
selectable options, which are PK's of a table.  In order to enhance the
system, I want to be lazy and store the values in the control.  To do
this I need some way of telling when the source table / view is out of
date and the data has changed.

I could set up Triggers to amend some lookup table containing a
timestamp of the change for a table.  But I am wondering if PostgreSQL
stores the last write timestamp to a table somewhere where it can be
checked easily?


Thanks again,

Ben Clewett.



Re: 'UNIQUE'

From
Tom Lane
Date:
Ben Clewett <B.Clewett@roadrunner.uk.com> writes:
> Does 'UNIQUE' allow multiple 'NULL' entries?

Yes; this is per SQL spec.

> But I am wondering if PostgreSQL
> stores the last write timestamp to a table somewhere where it can be
> checked easily?

No --- Postgres doesn't keep track of that at all.

For the particular situation you are describing, I don't think you
really want timestamps per se.  What you want is a trigger that will
send a NOTIFY message when the table changes.  Apps with dependent state
(like combobox entries) can LISTEN for this message and then rebuild
their local state when they get it.  This is much more efficient than
putting a timestamp someplace, because the recipients don't have to
waste cycles probing to find out if there's been an update.

            regards, tom lane

Re: 'UNIQUE'

From
Nabil Sayegh
Date:
Am Mon, 2003-03-17 um 15.33 schrieb Ben Clewett:

> Does 'UNIQUE' allow multiple 'NULL' entries?
>
> Ie:
>
> key_foo
> -------
>    1
>    2
>    NULL
>    9
>    8
>    NULL
>    4
>    NULL


test=# CREATE TEMP TABLE a (id int unique);
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'a_id_key' for
table '
a'
CREATE TABLE
test=# INSERT INTO a values (1);
INSERT 29440 1
test=# INSERT INTO a values (2);
INSERT 29441 1
test=# INSERT INTO a values (null);
INSERT 29442 1
test=# INSERT INTO a values (9);
INSERT 29443 1
test=# INSERT INTO a values (8);
INSERT 29444 1
test=# INSERT INTO a values (null);
INSERT 29445 1
test=# INSERT INTO a values (4);
INSERT 29446 1
test=# INSERT INTO a values (null);
INSERT 29447 1
test=# SELECT * from a;
 id
----
  1
  2

  9
  8

  4

(8 rows)

apparently it does.

cu
--
 e-Trolley Sayegh & John, Nabil Sayegh
 Tel.: 0700 etrolley /// 0700 38765539
 Fax.: +49 69 8299381-8
 PGP : www.e-trolley.de