Re: [GENERAL] Primary Keys

2016-04-29 Thread Adrian Klaver
On 04/29/2016 11:07 AM, Dustin Kempter wrote: Hi all, Is there a query I can run that will scan through all the tables of a database and give me a list of all tables without a primary key? Im not having any luck with this. Two options: First

Re: [GENERAL] Primary Keys

2016-04-29 Thread John McKown
On Fri, Apr 29, 2016 at 1:20 PM, Melvin Davidson wrote: > > > On Fri, Apr 29, 2016 at 2:07 PM, Dustin Kempter < > dust...@consistentstate.com> wrote: > >> Hi all, >> Is there a query I can run that will scan through all the tables of a >> database and give me a list of all

Re: [GENERAL] Primary Keys

2016-04-29 Thread Melvin Davidson
On Fri, Apr 29, 2016 at 2:07 PM, Dustin Kempter wrote: > Hi all, > Is there a query I can run that will scan through all the tables of a > database and give me a list of all tables without a primary key? Im not > having any luck with this. > > Thanks in advance! > >

[GENERAL] Primary Keys

2016-04-29 Thread Dustin Kempter
Hi all, Is there a query I can run that will scan through all the tables of a database and give me a list of all tables without a primary key? Im not having any luck with this. Thanks in advance! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] primary keys

2009-09-12 Thread Grant Maxwell
Hi Folks I'm looking for a bit of advice regarding alpha primary keys. I have a table (designed by someone else) that has a numeric primary key and also a unique non-null email address field. The use of the primary key is causing me some headaches in that in multiple database server

Re: [GENERAL] primary keys

2009-09-12 Thread Merlin Moncure
On Sat, Sep 12, 2009 at 12:35 PM, Grant Maxwell grant.maxw...@maxan.com.au wrote: Hi Folks I'm looking for a bit of advice regarding alpha primary keys. I have a table (designed by someone else) that has a numeric primary key and also a unique non-null email address field. The use of the

Re: [GENERAL] primary keys

2009-09-12 Thread Bill Moran
On Sun, 13 Sep 2009 02:35:02 +1000 Grant Maxwell grant.maxw...@maxan.com.au wrote: Hi Folks I'm looking for a bit of advice regarding alpha primary keys. I have a table (designed by someone else) that has a numeric primary key and also a unique non-null email address field. The use

Re: [GENERAL] primary keys

2009-09-12 Thread Merlin Moncure
On Sat, Sep 12, 2009 at 2:11 PM, Bill Moran wmo...@potentialtech.com wrote: On Sun, 13 Sep 2009 02:35:02 +1000 Grant Maxwell grant.maxw...@maxan.com.au wrote: Hi Folks I'm looking for a bit of advice regarding alpha primary keys. I have a table (designed by someone else) that has a numeric

Re: [GENERAL] primary keys

2009-09-12 Thread Grant Maxwell
On 13/09/2009, at 2:46 AM, Tom Lane wrote: Grant Maxwell grant.maxw...@maxan.com.au writes: I don't know why it was done this way but it seems to me that the email addresses are unique, non null and could be used as the primary key. This would make the replication much faster and simpler.

Re: [GENERAL] primary keys

2009-09-12 Thread Tom Lane
Grant Maxwell grant.maxw...@maxan.com.au writes: I don't know why it was done this way but it seems to me that the email addresses are unique, non null and could be used as the primary key. This would make the replication much faster and simpler. Does anyone out there think the change

Re: [GENERAL] primary keys

2006-04-21 Thread Patrick TJ McPhee
In article [EMAIL PROTECTED], Klint Gore [EMAIL PROTECTED] wrote: % works for me on version 8.1.3 % % SELECT attname % FROM pg_index %JOIN pg_class ON (indrelid = pg_class.oid) %JOIN pg_attribute ON (attrelid = pg_class.oid) % WHERE indisprimary IS TRUE %AND attnum = any(indkey) %

[GENERAL] primary keys

2006-04-19 Thread Orion Henry
I'm trying to craft a query that will determine what column(s) are the primary key for a given table. I have succeeded but the query is so ugly that it borders on silly and cannot work for an arbitrary number of tables since indkey is an int2vect and the ANY keyword does not work on it.

Re: [GENERAL] primary keys

2006-04-19 Thread Klint Gore
On Wed, 19 Apr 2006 19:39:45 -0700, Orion Henry [EMAIL PROTECTED] wrote: I'm trying to craft a query that will determine what column(s) are the primary key for a given table. I have succeeded but the query is so ugly that it borders on silly and cannot work for an arbitrary number of

Re: [GENERAL] Primary keys for companies and people

2006-02-07 Thread John D. Burger
Leif B. Kristensen wrote: Still, I'm struggling with the basic concept of /identity/, eg. is the William Smith born to John Smith and Jane Doe in 1733, the same William Smith who marries Mary Jones in the same parish in 1758? You may never really know. Still, collecting such disparate facts

Re: [GENERAL] Primary keys for companies and people

2006-02-06 Thread Michael Glaesemann
On Feb 4, 2006, at 2:23 , Merlin Moncure wrote: If you kind determine an easy natural differentiator, invent one: create table contact ( account text, name text, memo text, primary key(account, name, memo) ); The memo field is blank in most cases unlees it's needed. Suppose you were

Re: [GENERAL] Primary keys for companies and people

2006-02-03 Thread Merlin Moncure
I definitely agree with you here, Merlin. Mutability is not the issue at hand. May I ask what strategies you use for determining uniqueness for people? Well, that depends on the particular problem at hand. If you had two john smiths in your system, how would you distinguish them? If you

[GENERAL] Primary keys for companies and people

2006-02-02 Thread Michael Glaesemann
Hello, all! Recently there was quite a bit of discussion regarding surrogate keys and natural keys. I'm not interested in discussing the pros and cons of surrogate keys. What I'd like to find out are the different methods people actually use to uniquely identify companies and people

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Leif B. Kristensen
On Thursday 02 February 2006 09:05, Michael Glaesemann wrote: For people I'm more or less stumped. I can't think of a combination of things that I know I'll be able to get from people that I'll want to be able to add to the database. Starting off we'll have at least 7,000 individuals in the

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread David Goodenough
On Thursday 02 February 2006 09:07, Leif B. Kristensen wrote: On Thursday 02 February 2006 09:05, Michael Glaesemann wrote: For people I'm more or less stumped. I can't think of a combination of things that I know I'll be able to get from people that I'll want to be able to add to the

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Martijn van Oosterhout
On Thu, Feb 02, 2006 at 10:36:54AM +, David Goodenough wrote: Still, I'm struggling with the basic concept of /identity/, eg. is the William Smith born to John Smith and Jane Doe in 1733, the same William Smith who marries Mary Jones in the same parish in 1758? You may never really

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Ted Byers
- Original Message - From: Leif B. Kristensen [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Thursday, February 02, 2006 4:07 AM Subject: Re: [GENERAL] Primary keys for companies and people [snip] I'm very interested to hear what other use in their applications for holding

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Merlin Moncure
I should perhaps be posting this under another subject, but I feel that beneath the surface, Michael's problem and my own are strongly related. There is also the problem that a name can change. People change names by deed-poll, and also women can adopt a married name or keep their old one.

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Michael Glaesemann
On Feb 3, 2006, at 7:25 , Merlin Moncure wrote: There is also the problem that a name can change. People change names by deed-poll, and also women can adopt a married name or keep their old one. All in all an ID is about the only answer. I'll take the other side of this issue. The

Re: [GENERAL] Primary keys for companies and people

2006-02-02 Thread Mark Dilger
Michael Glaesemann wrote: Hello, all! Recently there was quite a bit of discussion regarding surrogate keys and natural keys. I'm not interested in discussing the pros and cons of surrogate keys. What I'd like to find out are the different methods people actually use to uniquely identify

Re: [GENERAL] Primary keys and speed

2001-09-09 Thread Rob Brown-Bayliss
Hi, I have not yet seen an answer to the following, can I assume it's not a problem? On Thu, 2001-09-06 at 19:58, Rob Brown-Bayliss wrote: Hello. I am looking at useing uuid's as primary keys rather than a normal sequence of numbers. The uuids are long text strings like so:

Re: [GENERAL] Primary keys and speed

2001-09-09 Thread Joe Conway
I am looking at useing uuid's as primary keys rather than a normal sequence of numbers. The uuids are long text strings like so: 7559e648-a29c-11d5-952f-00c026a18838 The reason for useing them is that it's almost gaurenteed that imported data from another site is going to have a

[GENERAL] Primary keys and speed

2001-09-06 Thread Rob Brown-Bayliss
Hello. I am looking at useing uuid's as primary keys rather than a normal sequence of numbers. The uuids are long text strings like so: 7559e648-a29c-11d5-952f-00c026a18838 The reason for useing them is that it's almost gaurenteed that imported data from another site is going to have a