2012-02-21_15:51:30-0500 Ron Peterson rpete...@mtholyoke.edu:
My rule below does not insert the the same uuid value into the test_log
table as is created in the test table when I insert a new value. I know
I've worked through this before, but I'm not remembering why this is.
What's a right
, attime )
values ( new.anid, new.value, 'insert', now() )
);
--
Ron Peterson
Network Systems Administrator
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org
SELECT
*
FROM
id_temp;
);
As you can see, I'm trying to create a simple 'insert or update' rule.
--
Ron Peterson
Network Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 1: if posting
INTO test ( aname ) VALUES ( 'yourusername' );
CREATE RULE lock_test_user_update
AS ON UPDATE TO test
WHERE old.aname = CURRENT_USER
DO INSTEAD nothing;
CREATE RULE lock_test_user_delete
AS ON DELETE TO test
WHERE old.aname = CURRENT_USER
DO INSTEAD nothing;
--
Ron Peterson
Network Systems Manager
, these rules should say !=, of course...
--
Ron Peterson
Network Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send
the scope of currval() is.
The value of currval will be predictable within the current session.
I.E., if another session increments the sequence, the value returned by
currval in the current session won't change.
Best.
--
Ron Peterson
Network Systems Manager
Mount Holyoke College
http
On Tue, Jan 07, 2003 at 11:01:08AM -0500, Tom Lane wrote:
Ron Peterson [EMAIL PROTECTED] writes:
CREATE RULE person_insert AS
ON INSERT TO person
DO
INSERT INTO person_log ( name_last, name_first, mod_type, person_id )
VALUES ( new.name_last, new.name_first, 'I', new.id
On Thu, Jan 09, 2003 at 11:53:42PM -0500, Tom Lane wrote:
Ron Peterson [EMAIL PROTECTED] writes:
On Thu, Jan 09, 2003 at 04:50:56PM -0500, Ron Peterson wrote:
colindices = (int *) malloc (ncols * sizeof (int));
Of course we should verify that malloc succeeded...
Actually, the correct
PointerGetDatum (newnewtuple);
}
--
Ron Peterson -o)
Network Systems Manager /\\
Mount Holyoke College_\_v
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 5: Have you checked
== SPI_ERROR_NOATTRIBUTE) {
elog (ERROR, noupcols: bad attribute value passed to SPI_modifytuple\n);
return PointerGetDatum (NULL);
}
return PointerGetDatum (newnewtuple);
}
--
Ron Peterson -o)
Network Systems Manager /\\
Mount Holyoke
On Wed, Jan 08, 2003 at 01:13:03PM -0500, Ron Peterson wrote:
On Tue, Jan 07, 2003 at 11:01:08AM -0500, Tom Lane wrote:
I thought that the idea behind noup was to protect single columns from
update. However, when I apply the noup trigger as above, I can't
update /any/ column
On Thu, Jan 09, 2003 at 04:50:56PM -0500, Ron Peterson wrote:
colindices = (int *) malloc (ncols * sizeof (int));
Of course we should verify that malloc succeeded...
if (colindices == NULL) {
elog (ERROR, noupcol: malloc failed\n);
SPI_finish();
return
be a pain.
So that's the problem I'd like to prevent, for which I think this
function would be useful. So I'll hack at it and see what I come up
with. Might not happen immediately, though..
--
Ron Peterson -o)
Network Systems Manager /\\
Mount Holyoke
=# select * from person;
name_last | name_first | id
---++
Peterson | Ronald | 1
Humbert | Humbert| 2
(2 rows)
directory=# update person set name_first='Ron' where name_first='Ronald';
NOTICE: id: update not allowed
UPDATE 0
--
Ron Peterson
BTW, PostgreSQL 7.2.1-2woody2 on Debian.
--
Ron Peterson -o)
Network Systems Manager /\\
Mount Holyoke College_\_v
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 5
On Thu, Jun 27, 2002 at 07:50:09PM +0800, q u a d r a wrote:
What's the best open source GUI for DB administration? (postgres)
Emacs. ;)
--
Ron Peterson -o)
87 Taylor Street /\\
Granby, MA 01033 _\_v
https://www.yellowbank.com
Can anyone suggest a more elegant way of finding foreign keys than
parsing the tgargs value returned by this query? I'd really rather do
pure SQL, sans string parsing, if possible.
-- Find tables and foreign keys
CREATE
The HTML programming documentation (e.g.
http://www.postgresql.org/devel-corner/docs/programmer/pg-system-catalogs.htm)
indicates that more extensive information about the system catalogs can
be found in the "Reference Manual". Where can this reference manual be
found? Or where can more
Tulio Oliveira wrote:
I appreciate any "C" Function complete samples, including de command
line for
the compiler.
I've attached a generic GNU make snippet for compiling .so files.
Adjust to suite your tastes. Like my math textbooks used to say
"writing the C code is trivial, and is left
Frank Joerdens wrote:
In a recent thread (How to represent a tree-structure in a relational
database) I asked how to do a tree structure in SQL, and got lots of
suggestions (thanks!), of which I chose the one below:
create table Category (
CategoryID int4 not null primary key,
Ron Peterson wrote:
CREATE TABLE category_edge (
parent INTEGER
NOT NULL
REFERENCES category_node(id),
child INTEGER
NOT NULL
REFERENCES category_node(id)
);
Just for the sake of anal-retentive
Stuart Statman wrote:
I would suggest, instead, to create a table that represents your hierarchy
without adding columns. For example :
create table Category (
CategoryID int4 not null primary key,
ParentCategoryID int4 not null REFERENCES Category (CategoryID),
CategoryName
22 matches
Mail list logo