Hi Tom,
Thanks for your response, enlightening as always.
> Not at present --- temp tables are not different from real tables,
> except for some naming shenanigans. So creation of a temp table will
> involve some disk hits.
Ok, would it be a good idea to modify that for the future? Given that
Josh Berkus wrote:
> Robert,
>
> > i'm reading the postgres documentation and i'm specifically
> > interested in creating stored procedures so that i can keep
> > as much of the business logic in the database as possible.
> > while reading 13.1.3 (SQL Functions on Composite Types) in
> > the Progr
IsNull work like this
SELECT IsNull( user_name, '') FROM user ;
then the query will return empty string when the field user_name is null
Regards
Bill
> > Hello all,
> >
> > I am a newbie to postgreSQL, is it possible to write a "DateDiff",
> > "IsNull" function work same as the one in SQL Se
Robert,
> i'm reading the postgres documentation and i'm specifically
> interested in creating stored procedures so that i can keep
> as much of the business logic in the database as possible.
> while reading 13.1.3 (SQL Functions on Composite Types) in
> the Programmer's Guide i come across the
i'm reading the postgres documentation and i'm specifically
interested in creating stored procedures so that i can keep
as much of the business logic in the database as possible.
while reading 13.1.3 (SQL Functions on Composite Types) in
the Programmer's Guide i come across the phrase...
"When
Hi,
I have an application where I am using fulltextindex to
create a searchable index for a table and wish to return
pages of results, ranked in order of relevance. So for any
particular page view I need to know:
a) Total number of results relevant to search (so I can display
page [1] 2 3 4 5
Randall Skelton <[EMAIL PROTECTED]> writes:
> problem #2: While this works perfectly for a small table of 10 entries, it
> crashes the database connection when I try to update 311537 rows
In present releases, plpgsql tends to leak a lot of memory intra-call;
you're probably just running out of me
Tom, Jan,
> MVCC does not mean "no locks" ... particularly not when UPDATEs are
> involved. You'll need to be more specific about what your function
> is
> doing, but my first thought would be to look for the possibility of
> conflicting updates of the same row.
Found the problem after 3 hours
MVCC does not mean "no locks" ... particularly not when UPDATEs are
involved. You'll need to be more specific about what your function is
doing, but my first thought would be to look for the possibility of
conflicting updates of the same row.
regards, tom lane
--
Hi all,
I am running 7.1.2 and I have the unenviable task of cleaning up a
database which has columns:
sgmty integer, -- YEAR
sgmtmo integer, -- MONTH
sgmtd integer, -- DAY
sgmth integer, -- HOUR
sgmtm integer, -- MINUTE
sgmts float, -- SECOND
+ 190 other floats per row
The d
Jason wrote:
> I am trying to retrieve records generated in the passed two days and
> encountered difficulties in dealing with the date in Oracle.
> Here is the query I try to form:
>
> select * from Table where InputDate>=[the day before yesterday]
>
> I tried "sysdate-2", didn't work.
> Any sugg
Josh Berkus wrote:
> Folks:
>
> I'm getting deadlock errors on one of the operations on my web
> application. It's a function which adds a large number of rows to a
> holding table, then updates that set of rows multiple times in order to
> present scoring information to the user.
>
> However, th
Hi Mike,
A few people have suggested this, but the thing I don't like (and I think at
some point William has also stated this) is that doing it this way, you lose
the logic (and the purity) of the data. If you allow the cyclic reference,
then the data behaves -and looks - exactly as it should
Folks:
I'm getting deadlock errors on one of the operations on my web
application. It's a function which adds a large number of rows to a
holding table, then updates that set of rows multiple times in order to
present scoring information to the user.
However, the function is deadlocking itself
Bill,
> I am a newbie to postgreSQL, is it possible to write a "DateDiff",
> "IsNull" function work same as the one in SQL Server and are there
> and
> sample out there?
I take it that you want to do this to port an exisiting application?
If so, the DateDiff thing has already been covered in
I am not sure if this will work with Oracle. I would like to know, so if
you could try out this test :
http://www.foxforum.com/showfullmessage.cfm?messageID=12382
If it does work, then you should be able to do this:
ldDby = date()-2
lnRet = sqlexec( h, "select * from Table where InputDate>=?ldD
I am trying to retrieve records generated in the passed two days and
encountered difficulties in dealing with the date in Oracle.
Here is the query I try to form:
select * from Table where InputDate>=[the day before yesterday]
I tried "sysdate-2", didn't work.
Any suggestions?
Thanks!
Jason
Tod McQuillin <[EMAIL PROTECTED]> writes:
> This makes me wonder... in the case of a stored complex view, would it be
> helpful to ask PostgreSQL to spend extra time in query optimisation and
> then cache the result? Or does it do this already?
I don't see any value in caching plans for views as
Help please!
How do I actually insert the variables OLD or NEW or a record type into a
table from within a trigger?
Like doing the following:
drop table th1;
create table th1(
id serial,
text text );
drop table th_audit;
create table th1_audit(
ts timestamp default now()
) inherits(th1);
dr
Alan Gutierrez <[EMAIL PROTECTED]> writes:
> On Tue, 14 Aug 2001, Bill wrote:
>> And is it possible to override the existing function and
>> operator like "+" to become a concate?
> Overloading operators? *Please* tell me that this is impossible.
I've got bad news ;-) ... it's pretty easy.
regr
Gary Stainburn <[EMAIL PROTECTED]> writes:
> ... However, I cannot find the
> syntax to create a function in SQL. Specifically, how you return the result.
See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xfunc.html#XFUNC-SQL
regards, tom lane
---
I know you can do it for days, thus:
expires = CURRENT_TIMESTAMP + 10
would be 10 days from now. Don't know about months though.
HTH
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk
- Original Message -
From: macky <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECT
The "create function" syntax is the same. The language syntax is straight
SQL:
CREATE FUNCTION getteamno(int4) RETURNS varchar AS '
SELECT tregion || ''/'' || to_char(tnumber, ''FM000'')
FROM teams
WHERE tid = $1
' LANGUAGE 'sql';
You don't get to build in error checking, but there has to be a
Title: RE: [SQL] Re: Are circular REFERENCES possible ?
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
The easiest way out is probably to create a relationship entity
called 'default' between customer and shop for the default
relationship. This way you only have to have one direct
relationsh
There's also PostgreSQL Replicator (which I haven't gotten around to
trying) :
http://pgreplicator.sourceforge.net
:-)
Regards and best wishes,
Justin Clift
Allan Engelhardt wrote:
>
> Ehhh, use dual-ported RAID disks? (Well, tri-port in your case, but maybe A and B
>machines are enough.
I am experimenting with running PG 7.1.2 on Mac OSX. I seem to
have a problem with getting my users to connect. This works
beautifully when connect to my linux box.
Any ideas?
[localhost:/etc] postgres% /usr/local/pgsql/bin/postmaster -i -p5444 -D
/users/postgres/pgdata
DEBUG: database sys
Hi,
I've been browsing the newsgroup archives and came across the following:
> > > > > Can you see a scenario where a programmer would forget to
delete the
> > > > > data from pg_largeobject and the database becoming very large
filled
> > > > > with orphaned large objects?
Does this mean that
When I do
createlang -U postgres -d mydbname pgplsql mydbname
I got can't find /usr/share/pgsql/plpgsql.so error message.
But there is no plpgsql.so file in /usr/share/pgsql directory!
I just installed RPM binary 7.1.2 for Redhat 6.2
In 7.0 the pgplsql.so file is located in /usr/lib/pgsql/
So
On Tue, 14 Aug 2001, Jan Wieck wrote:
> Mister ics wrote:
> > testdb=>create table t1 (
> >id int primary key,
> >foo int);
> > testdb=>create table t2 (
> >id int primary key,
> >ref int references t1(id) on update restrict);
> So an attempt to
>
> UPDATE t1 SET id
When I do
select * from pg_database;
I got
datname | ... | datlastsysoid
mydbname | ... | 18539
But When I
cd $PGDATA/data/base/
ls -la
I got
1
18719
18725
Where is 18539 ??!!
I think mydbname is 18725
When I
cd 18725
ls
There are
I denis,
I don't know if you can use a circular REFERENCES, but why you try made a
references before the table is created (customers). You should create the
references after and use the foreign key if circular references does not
work.
William
"Denis Bucher" <[EMAIL PROTECTED]> a écrit dans le m
Hi all,
As I was reading up on create function etc. while learning plpgsql, I seam to
remember it stated that as well as plpgsql, that other languages are/will be
available including using SQL as the language. However, I cannot find the
syntax to create a function in SQL. Specifically, how y
Mister ics wrote:
> Hi,
>
> I'm a little confused by the "on update restrict" option in a referential
> integrity constraint. I don't know if i have not understood the meaning of
> this statement or it does not work properly.
> I think that if it is specified ON UPDATE RESTRICT in a foreign key
>
Hi,
I'm a little confused by the "on update restrict" option in a referential
integrity constraint. I don't know if i have not understood the meaning of
this statement or it does not work properly.
I think that if it is specified ON UPDATE RESTRICT in a foreign key
costraint, the sql-server sh
Hello all,
I am a newbie to postgreSQL, is it possible to write a "DateDiff",
"IsNull" function work same as the one in SQL Server and are there and
sample out there? And is it possible to override the existing function and
operator like "+" to become a concate?
Regards
Bill
---
35 matches
Mail list logo