let's say you have the name of a table in a string.
'mytable'
you also have field names, such as
'lookupfield' 'valuefield'
which would be assembled like this
select valuefield from mytable where lookupfield = '?'
is there a way to write sql/plpgsql that'll take a var
will trillich <[EMAIL PROTECTED]> writes:
> is it possible to have a rule DO INSTEAD more-than-one-thing?
Sure. Observe the CREATE RULE reference page:
CREATE RULE name AS ON event
TO object [ WHERE condition ]
DO [ INSTEAD ] action
where action can be:
NOTHING
|
query
|
( query ; que
so who's got a clever implementation of cross-linguistic texts?
create table something (
id serial,
yadayada int4,
whatever date,
mumble float8,
en varchar(50), -- english
es varchar(50), -- e
"Randall F. Kern" <[EMAIL PROTECTED]> writes:
> I have an web application that sometimes hangs. When I run ps I see a
> postgresql thread that says "INSERT waiting" (I don't have the exact
> text in front of me, but it's similar to that). When this happens my
> only recourse is to restart my web
On Thu, Mar 22, 2001 at 07:14:49PM -0600, will trillich wrote:
> CREATE VIEW who AS
> SELECT * from _who;
>
> CREATE RULE
> who_insert
> AS ON
> INSERT TO who
> DO INSTEAD
> INSERT INTO "_who" (
>
"datactrl" <[EMAIL PROTECTED]> writes:
> I use a win32 psql to connect to a linux box. It will take about 20 seconds
> to connect to postgres server while linux and my PC are in a LAN.
A first guess is that there's something broken about your DNS setup,
and that you're suffering a DNS lookup time
I use a win32 psql to connect to a linux box. It will take about 20 seconds
to connect to postgres server while linux and my PC are in a LAN. My linux
runs dhcpd, smb, and internet sharing, do they matter?
JACK
---(end of broadcast)---
TIP 5: Have
Gunnar R|nning <[EMAIL PROTECTED]> writes:
> Seems you hit the nail with your theory :
> sf-ng=# select date_part('seconds', a_accesstime) from access_log where
> a_accesstime > '2000-10-24 15:14:59' limit 1;
> date_part
> ---
> 59.997
> (1 row)
Ah-hah. And we print that with a "%.
On Thu, Mar 22, 2001 at 06:33:16PM -0500, Jan Wieck wrote:
> Einar Karttunen wrote:
> How do you put a UNIQUE constraint on the entire inheritance
> hierarchie?
Easy. You make a unique index that covers an entire inheritance hierarchy.
If lots of table inherit a field "id" from a single
Limin Liu <[EMAIL PROTECTED]> writes:
> By the way, did you change the whole archetecture of SPI invocation?
No, I told you: what's broken here is the textout() call. Attached
is the updated example.
> I put
> ---
>SPI_connect();
>SPI_exec("create temp table tbl_tmp (n int);",0);
>S
Limin Liu <[EMAIL PROTECTED]> writes:
> I am learning and using SPI. In PostgreSQL documentation chapter "Server
> Programming Interface," there is a small example name "execq(text,
> int)".
> This example works as the document says on 7.0.3 and earlier version,
> but this example DOES NOT work on
On Thu, 22 Mar 2001, Jonas Bengtsson wrote:
> Hello,
> I have problems with using OID as PK. I have created a
> UNIQUE INDEX on the oid on a relation called CourseEvents.
> The relation that is supposed to have a FK to CourseEvents
> is CourseEventsForums and it has a field called ceid which
Title: RE: Re: [GENERAL] OID as Primary Key
Isn’t is better to use nextval(). If there are many simultaneous
users vurrval might give the value of another insert.
/Jonas B
-Original
Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Ansley
Title: RE: Re: [GENERAL] OID as Primary Key
And you can get the last SERIAL inserted using currval.
MikeA
>> -Original Message-
>> From: Brent R. Matzelle [mailto:[EMAIL PROTECTED]]
>> Sent: 22 March 2001 16:36
>> To: [EMAIL PROTECTED]
>> Subject: Re: Re: [GENERAL] OID as Primary
--- Jonas Bengtsson <[EMAIL PROTECTED]> wrote:
> Can't you do a dump with the oid's?
Yes, but I would never suggest it.
> But when I want to know the primary key of the inserted row
> I have to do an extra select query. If I use oid I just use
> pg_getlastoid() in php.
> And it is redundant d
3/22/2001 12:55:39 AM, "Joseph" <[EMAIL PROTECTED]> wrote:
>What all must I do to change from the rpm installed version to the
>compilable version?
>
>Do I need to uninstall the rpms?
No, you can have both versions on the same system.
---
Brent R. Matzelle
Software Engineer
Information Services
can i use pl/pgsql to write a trigger to update a separate table?
for example if i have a table student:
nametext,
id text,
group int,
statint,
and another table status:
stattext
group int
count int
and i update the stat in the student table, can i update the count
column
Can't you do a dump with the oid's?
But when I want to know the primary key of the inserted row
I have to do an extra select query. If I use oid I just use
pg_getlastoid() in php.
And it is redundant data to store another integer.
Comments?
/Jonas B
> Jonas Bengtsson <[EMAIL PROTECTED]> wri
"Tamsin" <[EMAIL PROTECTED]> writes:
> I'm not sure how the database got in this state - would this happen when I
> drop & recreate a user?
Yes. There's no crosscheck to see if you still have active GRANTs for
the user being deleted. (Which is bad but that's how it is at the moment.)
> Is ther
Jeff Butera <[EMAIL PROTECTED]> writes:
> UPDATE STUDENT_ANSWERS SET CORRECT=QA.CORRECT
> FROM QUESTION_ANSWERS QA,STUDENT_ANSWERS SA
> WHERE SA.CORRECT=null
> AND SA.QUESTIONS_ID=QA.QUESTIONS_ID
> AND SA.ANSWERS_ID=QA.ANSWERS_ID;
What you've got here is a three-way join between
Jonas Bengtsson <[EMAIL PROTECTED]> writes:
> I have problems with using OID as PK.
This strikes me as a fairly bad idea in any case. What happens if you
must dump and reload your database? Better to use a SERIAL column as
primary key.
regards, tom lane
---
I dont think so ..
Transactions need to be atomic.. Either succeed or fail.. I thik what
postgressql does is quite OK only a little irritating if u are issuing
command thru the psql terminal..
Anand
On Thu, Mar 22, 2001 at 10:15:54AM +0100, DaVinci wrote:
> Hello. I have a problem with Postgresql
On Thu, 22 Mar 2001, Richard Huxton wrote:
>
> I have to admit I've never tried referencing a view with a foreign key. I
> don't know if it's possible and I have to admit the idea makes me
> uncomfortable. Can't give a good reason why, but I'd apply constraints at
> the table level.
if one can ref
From: "Joseph" <[EMAIL PROTECTED]>
> What all must I do to change from the rpm installed version to the
> compilable version?
>
> Do I need to uninstall the rpms?
In theory, you could probably run both, but it's probably easier to pg_dump
your databases, uninstall the rpms and compile the source
unsubscribe
Daniel Francisco Sachet
Diretor de Tecnologia de Informação
IFX do Brasil - www.ifx.com.br
+55 11 3365-5860
+55 11 9119-0083
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Hi,
when I pg_dump my database, I get lines like:
GRANT SELECT on "tablename" to "28";
When I restore from the dump file, I get errors:
ERROR: aclparse: non-existent user "28"
The dump file does contain grants for the real users which exist in the
database, and I've checked pg_shadow, and there
DaVinci <[EMAIL PROTECTED]> wrote:
> When I am in middle of transaction and there is an error, for example
> caused by trying to insert a tupla with a "not null" value without valor,
> I get error:
>
> NOTICE: current transaction is aborted, queries ignored until end of
> transaction b
Hello. I have a problem with Postgresql 7.1 beta (Debian packages).
When I am in middle of transaction and there is an error, for example
caused by trying to insert a tupla with a "not null" value without valor, I
get error:
NOTICE: current transaction is aborted, queries ignored unt
From: "Feite Brekeveld" <[EMAIL PROTECTED]>
> Stephan Szabo wrote:
>
> > On Thu, 22 Mar 2001, Feite Brekeveld wrote:
> >
> > > Hi,
> > >
> > > I have put an AFTER INSERT TRIGGER on a table.
> > >
> > > If the triggerfunction fails to do an operation shouldn't the insert
> > > already have taken
I'm new to postgres and am having an UPDATE problem when
using a join. I've got two tables like so:
CREATE TABLE QUESTION_ANSWERS (
QUESTIONS_ID int4 NOT NULL, -- question ID
ANSWERS_ID int4 NOT NULL, -- answer ID
CORRECTboolean
);
CREATE TABLE STUDENT_ANSWERS (
S
On Wed, 21 Mar 2001, Tim Frank wrote:
> John,
>
> Thanks for mentioning that fix :) I'm sure one could run sed or
> something similar to remove that line at the top of the file after the
> backup has completed (I shall have to try that sometime).
It's probably easier to set PGUSER and PGP
I am trying to output news. An article can have an image or not sometimes.
Can someone help me get this to work in Postgres?
select a.article_id, a.title, a.url, a.synopsis, a.publish_date,
c.parent_category_id, c.category_id, c.category_name,
i.server_image_name
from ((article a JOIN articl
Hello,
I have problems with using OID as PK. I have created a
UNIQUE INDEX on the oid on a relation called CourseEvents.
The relation that is supposed to have a FK to CourseEvents
is CourseEventsForums and it has a field called ceid which
has oid as dtatype.
But when I try to create a FK to t
33 matches
Mail list logo