I found a simple solution, but i don't know how to add raises an exception here.
create rule protect_profile_id0_update as on update to web.profile
where old.id = 0 do instead nothing;
create rule protect_profile_id0_delete as on delete to web.profile
where old.id = 0 do instead nothing;
2011
Copy to a staging table without the constraint and then write a query to
consolidate/remove the duplicate data and insert the clean data into the final
table.
It doesn't just give a warning because not importing a record from the source
data should be a fatal error since it means you have a des
Hi,
create a delete trigger that raises an exception
Thomas
Am 19.12.2011 07:43, schrieb Капралов Александр:
Hi all.
How to make a non-removable row in a table?
In my case, I should not accidentally delete a row with id = 0.
CREATE TABLE profile (
id integer NOT NULL,
name char
I am using COPY public.table_name FROM STDIN to import data. it is
very efficient, but if there's any duplicate key exists, the whole
procedure has been stopped. is there anyway to around this?
why does not postgresql just give a warning and continue the copy?
--
Sent via pgsql-general mailin
Hi all.
How to make a non-removable row in a table?
In my case, I should not accidentally delete a row with id = 0.
CREATE TABLE profile (
id integer NOT NULL,
name character varying(265) NOT NULL
);
CREATE SEQUENCE profile_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
never mind. just found I changed the wal_keep_segments to 5000, it's
the size of pg_xlog dir who used a lot of space.
On Sun, Dec 18, 2011 at 10:18 PM, Yan Chunlu wrote:
> I just tried several times to make sure I didn't do anything wrong.
>
> I use
> pg_dump -U postgres -E UTF8 -F c -b -v -a
Yes i was trying to determine how to make a View work in this situation.
From reading the details on PostgreSQL Views are not persistent, ie they
are just a SQL query short hand rather than actually creating any physical
entity backing it (i would imagine that creating such a physical backing woul
On Sat, Dec 17, 2011 at 6:06 PM, Robert James wrote:
> On 12/15/11, Marti Raudsepp wrote:
>> On Thu, Dec 15, 2011 at 18:10, Robert James wrote:
>>> How do I do the equivalent of an ANY() or ALL() in PG Aggregate SQL?
>>
>> Note that in many cases, writing an EXISTS(SELECT ...) or NOT
>> EXISTS(.
On Fri, Dec 16, 2011 at 3:59 AM, Rick Pufky wrote:
> Any thoughts on the above snippets? Am I interpreting the documentation
> correctly? Is there any further information needed to debug this?
You need to share the archive directory between all three nodes to use that
trick.
To follow the timeli
I've shown you how to make a proper VIEW that will accomplish what you want
(i.e., 9 "UNION ALL" between 10 tables). Yes, the VIEW is simply a
re-write RULE but the indexes on the corresponding tables are still very
much real and "should" be used to when you make use of the VIEW over one of
the t
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of amit sehas
Sent: Thursday, December 15, 2011 9:22 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] indexes and tables
HI,
we have a schema related question. We have 1
On Dec 15, 2011, at 10:12 PM, Patrick Kevin McCaffrey wrote:
> Hello,
>
> I'm new to PostgreSQL, but am trying to set up a server on my machine. The
> PostgreSQL server is to run inside of a LXC container - I'm not sure if this
> is contributing to my problem or not, but it's worth mentioning
Hello,
I'm new to PostgreSQL, but am trying to set up a server on my machine. The
PostgreSQL server is to run inside of a LXC container - I'm not sure if this is
contributing to my problem or not, but it's worth mentioning. The main OS
(host) of my machine is Ubuntu 11.10 (mostly, some packa
HI,
we have a schema related question. We have 10 types of resource records.
Each one of these resource records has 3 fields (attributes) (lets say f1, f2,
f3)...these fields have similar meaning to the corresponding 3 fields
in each resource record although they be named slightly differently in
I'm attempting to make use of the ability defined by the statement at the
end of the first paragraph in this section of the documentation (
http://www.postgresql.org/docs/9.1/static/warm-standby.html#STANDBY-SERVER-SETUP).
Specifically, "If you plan to have multiple standby servers for high
availab
I just tried several times to make sure I didn't do anything wrong.
I use
pg_dump -U postgres -E UTF8 -F c -b -v -a dbcontent -f data.backup
then
pg_restore -a -d dbcontent data.backup
to restore a db, and the data dir's size on the source machine is
56GB, after I restored data on the target
16 matches
Mail list logo