Thanks, guys. Worked like a charm.
Carol
On Aug 25, 2009, at 6:25 PM, Scott Marlowe wrote:
On Tue, Aug 25, 2009 at 2:25 PM, Carol Walter
wrote:
This may be a silly question but I don't see any place where the
documentation explicitly addresses whether or not you can designate a
particular co
Carol Walter wrote:
This may be a silly question but I don't see any place where the
documentation explicitly addresses whether or not you can designate a
particular column as a primary key after the table is created. I used
the "create table as " syntax to create a table with the same columns
On Tue, Aug 25, 2009 at 2:25 PM, Carol Walter wrote:
> This may be a silly question but I don't see any place where the
> documentation explicitly addresses whether or not you can designate a
> particular column as a primary key after the table is created. I used the
> "create table as " syntax to
On Aug 25, 2009, at 3:25 PM, Carol Walter wrote:
This may be a silly question but I don't see any place where the
documentation explicitly addresses whether or not you can designate
a particular column as a primary key after the table is created. I
used the "create table as " syntax to cr
Carol Walter wrote:
> This may be a silly question but I don't see any place where the
> documentation explicitly addresses whether or not you can designate
> a particular column as a primary key after the table is created.
It sounds like you need ALTER TABLE DROP CONSTRAINT and ALTER TABLE
This may be a silly question but I don't see any place where the
documentation explicitly addresses whether or not you can designate a
particular column as a primary key after the table is created. I used
the "create table as " syntax to create a table with the same columns
as an original
Create a sequence and use the sequence in your insert statement.
On Thu, 2008-12-11 at 15:27 -0800, Marc Fromm wrote:
> I created this table:
>Column | Type | Modifiers
> ++
>first_name | charact
On Thursday 11 December 2008 03:27:59 pm Marc Fromm wrote:
> id | integer | not null
I believe you did not set the field 'id' to a data type of serial. If you had
you would have "nextval(" in the Modifiers column.
--
John Fabiani
--
Sent via pgsql-admin mailing
Marc Fromm wrote:
I created this table:
...
id | integer | not null
Indexes:
"alert_list_pkey" PRIMARY KEY, btree (id)
I get this error when I run the insert a listed below. The insert does
not have an entry for the primary key "id" since I thought it upd
I created this table:
Column | Type | Modifiers
++
first_name | character varying(20) |
last_name | character varying(30) |
w_number | character varying(9)|
alert | character va
Yes, PG allows compound or composite keys for primary keys.
Igor
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Carol Walter
Sent: Wednesday, September 19, 2007 10:37 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Primary key
Hello,
Does postgres
On 19 sep 2007, at 16.37, Carol Walter wrote:
Does postgres allow compound or composite keys for primary keys? I
thought I read someplace that it didn't. Now, I can't find a
reference to it.
Yes, it does.
http://www.postgresql.org/docs/8.2/interactive/ddl-
constraints.html#AEN2080
Si
--- Carol Walter <[EMAIL PROTECTED]> wrote:
> Does postgres allow compound or composite keys for primary keys? I
> thought I read someplace that it didn't. Now, I can't find a
> reference to it.
It does. composite key are defined as a table constraint:
http://www.postgresql.org/docs/8.2/in
Hello,
Does postgres allow compound or composite keys for primary keys? I
thought I read someplace that it didn't. Now, I can't find a
reference to it.
Carol
---(end of broadcast)---
TIP 5: don't forget to increase your free space map setti
--- Jessica Richard <[EMAIL PROTECTED]> wrote:
> Just want to be very clear that:
>
> 1. adding a primary key will have an implicit index automatically on the
> column(s).
>
> 2. Adding a foreign key will NOT have an index created automatically, it only
> does the
> referencing work. If an in
Just want to be very clear that:
1. adding a primary key will have an implicit index automatically on the
column(s).
2. Adding a foreign key will NOT have an index created automatically, it only
does the referencing work. If an index is needed on the F-key column, it has to
be created, right?
I am running a 7.4.3 postgreSQL database on RHEL 3.
I have encountered two cases where tables have multiple key values, in
violation of a primary key constraint. I discovered this after receiving
SQL exceptions, where the primary key constraint was all of a sudden
being enforced again. This may be
I am trying to figure out how I can change the default operator class of the
index created for my primary key field. Is it even possible since I am not
able to find the syntax?
Or do I need to create the primary key and then an additional index with the
operator class I want. (It would be a wast
On Mon, 28 Jan 2002, Marc Mitchell wrote:
> pgsqlPostgres automatically creates a unique index to assure data integrity
> (see CREATE INDEX statement).
>
> The online docs at
> http://www.postgresql.org/idocs/index.php?sql-createtable.html state the
> following:
>
> " Postgres automatically creat
pgsqlPostgres automatically creates a unique index to assure data integrity
(see CREATE INDEX statement).
The online docs at
http://www.postgresql.org/idocs/index.php?sql-createtable.html state the
following:
" Postgres automatically creates a unique index to assure data integrity
(see CREATE IN
I did have this problem in the past. I have a table with three fields
set for the primary key. Somehow I would get dups in that table. I'm
not sure how as I am too busy to test it. I changed my insert queries
to check for existing data before the insert so I could get back to
work.
Someone di
Tony / Phil,
my 2c on the Primary Key definition / usage. If you have any SQL / DDL code
that disagrees with the definitions below could you please repost them.
"Tony Reina" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] (Phill Kenoyer) wro
[EMAIL PROTECTED] (Phill Kenoyer) wrote in message
news:<[EMAIL PROTECTED]>...
> Here is a good one. I have three fields set for my primary key. Now I
> thought that a primary key was unique, and dups can not be inserted.
>
I don't think primary keys per se are unique, but rather can be made
Phill and Glen,
We've just tracked down one mechanism that allows duplicate rows to be
spawned --- see http://fts.postgresql.org/db/mw/msg.html?mid=1078374
and following discussion. In the example given by Brian Hirt, VACUUM's
creation of a duplicate row causes a unique-key violation to be
repor
On Fri, 7 Dec 2001, Phill Kenoyer wrote:
> I took your advice and checked the string size using char_length() and
> octet_length(). They are the same.
>
> octet_length | stock| octet_length | inventory_type | client_id
> 5 | 10725 |4 | used |
I took your advice and checked the string size using char_length() and
octet_length(). They are the same.
octet_length | stock| octet_length | inventory_type | client_id
5 | 10725 |4 | used |60
5 | 10725 |4 | use
On Saturday 08 December 2001 02:44, Phill Kenoyer wrote:
> Here is a good one. I have three fields set for my primary key. Now I
> thought that a primary key was unique, and dups can not be inserted.
That's the theory ;-)
> CREATE TABLE "inventory" (
> "stock" character varying(50) NOT
Here is a good one. I have three fields set for my primary key. Now I
thought that a primary key was unique, and dups can not be inserted.
CREATE TABLE "inventory" (
"stock" character varying(50) NOT NULL,
"inventory_type" character varying(20) DEFAULT 'unknown' NOT NULL,
On Mon, 10 Sep 2001, Mohammad Faisal wrote:
> the primary key in postgreSQL is implemented as unique
> index and the unique index can be deleted and as a
> result the primary key constraints finishes.(oh a
> problem)
> what if i don't want an index on a table then in this
> case how can i impleme
hey all,
the primary key in postgreSQL is implemented as unique
index and the unique index can be deleted and as a
result the primary key constraints finishes.(oh a
problem)
what if i don't want an index on a table then in this
case how can i implement Primary key constraint.
any help
t
30 matches
Mail list logo