Hello,
when trying to add a forgotten primary key pair
to a PostgreSQL 8.4.13 table I get the error:
# \d pref_rep
Table public.pref_rep
Column |Type | Modifiers
On 02/04/2013 06:17 AM, Alexander Farber wrote:
Hello,
when trying to add a forgotten primary key pair
to a PostgreSQL 8.4.13 table I get the error:
# \d pref_rep
Table public.pref_rep
Column |Type |
Thank you -
On Mon, Feb 4, 2013 at 3:26 PM, Andrew Jaimes andrewjai...@hotmail.com wrote:
SELECT id, author, count(1)
FROM pref_rep
GROUP BY id, author
HAVING count(1) 1
From: alexander.far...@gmail.com
Trying to delete the older of the duplicated pairs:
# SELECT id, author, count(1), max(stamp) as maxx
FROM pref_rep
GROUP BY id, author
HAVING count(1) 1 and stamp maxx;
ERROR: column maxx does not exist
LINE 4: HAVING count(1) 1 and stamp maxx;
^
On
On 02/04/2013 06:45 AM, Alexander Farber wrote:
Trying to delete the older of the duplicated pairs:
# SELECT id, author, count(1), max(stamp) as maxx
FROM pref_rep
GROUP BY id, author
HAVING count(1) 1 and stamp maxx;
ERROR: column maxx does not exist
LINE 4: HAVING count(1) 1 and stamp
Unfortunately that fails -
On Mon, Feb 4, 2013 at 3:55 PM, Adrian Klaver adrian.kla...@gmail.com wrote:
On 02/04/2013 06:45 AM, Alexander Farber wrote:
Trying to delete the older of the duplicated pairs:
How about:
SELECT id, author, count(1), max(stamp) as maxx
FROM pref_rep
GROUP
On 02/04/2013 06:45 AM, Alexander Farber wrote:
Trying to delete the older of the duplicated pairs:
# SELECT id, author, count(1), max(stamp) as maxx
FROM pref_rep
GROUP BY id, author
HAVING count(1) 1 and stamp maxx;
ERROR: column maxx does not exist
LINE 4: HAVING count(1) 1 and stamp
Alexander Farber alexander.far...@gmail.com wrote:
# alter table pref_rep add primary key(id, author);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
pref_rep_pkey for table pref_rep
ERROR: could not create unique index pref_rep_pkey
DETAIL: Table contains duplicated
Andreas Kretschmer akretsch...@spamfence.net wrote:
Alexander Farber alexander.far...@gmail.com wrote:
# alter table pref_rep add primary key(id, author);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
pref_rep_pkey for table pref_rep
ERROR: could not create unique
Thank you -
On Mon, Feb 4, 2013 at 5:06 PM, Andreas Kretschmer
akretsch...@spamfence.net wrote:
# alter table pref_rep add primary key(id, author);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
pref_rep_pkey for table pref_rep
ERROR: could not create unique index
Alexander Farber alexander.far...@gmail.com wrote:
Thank you -
On Mon, Feb 4, 2013 at 5:06 PM, Andreas Kretschmer
akretsch...@spamfence.net wrote:
# alter table pref_rep add primary key(id, author);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
pref_rep_pkey for
11 matches
Mail list logo