2012-02-21_15:51:30-0500 Ron Peterson :
> 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
est_log ( anid, value, op, 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
username = id_temp.username;
INSERT INTO
id
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
-
you, and if you had
> something to recommend.
You might want to look at dbmail.
http://www.dbmail.org/index.php?page=overview
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
t; DO INSTEAD nothing;
For your example, 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 o
RT INTO test ( aname ) VALUES ( 'aaa' );
INSERT 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
;
INSERT INTO
foo_bar ( foo_id, c )
VALUES
( currval( 'foo_foo_id_seq' ), ... );
);
(Which would mean there's no reason for view 'bar' to display foo_id)
Hmm, just noticed you defined foo.foo_id to be type 'serial', so you
could omit foo_id in the f
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 )
> > VAL
elog (ERROR, "noupcols: bad argument to SPI_modifytuple\n");
}
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
elog (ERROR, "noupcols: bad attribute value passed to SPI_modifytuple\n");
}
pfree (oldcolvals);
pfree (newcolval);
pfree (colindi
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
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();
pfree (oldcolvals);
free (colindices);
SPI_finish ();
if (SPI_result == SPI_ERROR_ARGUMENT) {
elog (ERROR, "noupcols: bad argument to SPI_modifytuple\n");
return PointerGetDatum (NULL);
}
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
elog (ERROR, &qu
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
n when the sequence hits that ID,
it will crap out. Maybe just try again, but what if that happened to
a bunch of records? Could 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
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)---
T
the intended behaviour?
e.g.
directory=# 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'
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.yel
Don't drive yourself crazy ( like me ;). You'll have to write some
procedural code - sorry. I believe IBM's DB/2 supports recursive
queries as defined by SQL3. Oracle provide a couple of non SQL standard
clauses (CONNECT BY, LEVELS) to provide similar funcionality.
-Ron-
GPG and other info at:
Mike D'Agosta wrote:
>
> Hi,
>
>I have a number of empty tables and I want to get the column names and
> data types with an SQL statement. I want to do this procedurally, not
> interactively (so I can't use \d in psql). Postgres doesn't
> support DESCRIBE... is there any other way to do thi
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 VI
I just recieved SQL in a Nutshell from O'Reilly. I bought the book
because it covers the SQL99 standard. It's my understanding that this
is the most recent SQL standard. Am I correct about this? What is the
current status of SQL standards? What is the most recent approved
standard, and what a
Thomas SMETS wrote:
>
>
> ISBN's have a checkdigit; it would be sensible to provide a
> function to be used in a CHECK constraint to ensure that the
> ISBN is valid.
>
Here's a URL with more
information:http://www.isbn.spk-berlin.de/html/userman/usm4.htm.
I've written a similar algorithm in
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),
> Category
Ron Peterson wrote:
>
> CREATE TABLE category_edge (
> parent INTEGER
> NOT NULL
> REFERENCES category_node(id),
>
> child INTEGER
> NOT NULL
> REFERENCES category_node(id)
>
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 k
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 lef
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 extensiv
Ron Peterson wrote:
>
> This structure is more 'normal' in the sense that nodes without children
> (in a tree, the leaf nodes) don't have records in the edge table.
Phghpth. Should have had my coffee first. The first data structure
given would only have a null parent i
28 matches
Mail list logo