am Wed, dem 25.04.2007, um 21:01:13 -0400 mailte Eddy D. Sanchez folgendes:
> Hello...
> I need to get the a total number of business days (from monday to
> friday) between two dates.
> Someone can help me please.
For instance the number of business days between 2007-04-01 and
2007-04-30:
sele
tom wrote:
In pgsql I have to modify this a bit with 'cast (s_msgs as double
precision)' or 'cast(s_msgs as real)' in order to get floating point math.
( cast(s_msgs as double precision)/S_msgs) and so on...
Question: Is there a better way to get floating point math out of a set
of integers
Ron Mayer <[EMAIL PROTECTED]> wrote:
>
> Carlos Moreno wrote:
> > Tom Lane wrote:
> >> Well, if you can't update major versions that's understandable; that's
> >> why we're still maintaining the old branches. But there is no excuse
> >> for not running a reasonably recent sub-release within your b
Eddy D. Sanchez wrote:
Hello...
I need to get the a total number of business days (from monday to
friday) between two dates.
Someone can help me please.
Whether you're using PHP or not, this page may be of some help:
http://www.php.net/manual/en/function.date.php
There are a couple of exa
On Wed, 25 Apr 2007, Eddy D. Sanchez wrote:
I need to get the a total number of business days (from monday to friday)
between two dates. Someone can help me please.
Joe Celko's "SQL for Smarties, 2nd Edition" has exactly this solution.
Check it out!
Rich
--
Richard B. Shepard, Ph.D.
Hello...
I need to get the a total number of business days (from monday to
friday) between two dates.
Someone can help me please.
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
Tom Lane wrote:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
>> Steve Crawford wrote:
>>> Am I reading that what it actually does is to thrash around keeping
>>> indexes unnecessarily updated, bloating them in the process?
>
>> Yes.
>
> Just for the record, it's not "unnecessary". The point of t
Ron Mayer wrote:
Carlos Moreno wrote:
Tom Lane wrote:
Well, if you can't update major versions that's understandable; that's
why we're still maintaining the old branches. But there is no excuse
for not running a reasonably recent sub-release within your branch.
Slammer..bug in Microsucks SQL
On Wed, 2007-04-25 at 12:47 -0400, Owen Hartnett wrote:
> I want to "freeze" a snapshot of the database every year (think of
> end of year tax records). However, I want this frozen version (and
> all the previous frozen versions) available to the database user as
> read-only.
First, I'd renam
Carlos Moreno wrote:
> Tom Lane wrote:
>> Well, if you can't update major versions that's understandable; that's
>> why we're still maintaining the old branches. But there is no excuse
>> for not running a reasonably recent sub-release within your branch.
>
> Slammer..bug in Microsucks SQL Server
"Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes:
> Hello all,
>
> I know I may be asking too much, but I have a very limited C/C++ (as well as
> PostgreSQL internal architecture) knowledge. I've tried compiling the C
> source code Manuel sent as a PostgreSQL loadable module on Visual Studio
>
I don't see a way to remove the old index entries before inserting new
ones without creating a window where the index and table will be
inconsistent if vacuum fails.
VACUUM FULL is slow because it plays with the indexes...
CLUSTER is slow because it has to order the rows...
M
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Steve Crawford wrote:
>> Am I reading that what it actually does is to thrash around keeping
>> indexes unnecessarily updated, bloating them in the process?
> Yes.
Just for the record, it's not "unnecessary". The point of that is to
not leave a corrup
On Apr 25, 2007, at 9:42 AM, Simon Riggs wrote:
On Thu, 2007-04-19 at 15:48 -0500, Thomas F. O'Connell wrote:
"If we take a backup of the standby server's files while it is
following logs shipped from the primary, we will be able to reload
that data and restart the standby's recovery process
Hello all,
I know I may be asking too much, but I have a very limited C/C++ (as well as
PostgreSQL internal architecture) knowledge. I've tried compiling the C
source code Manuel sent as a PostgreSQL loadable module on Visual Studio
.NET 2003 (C++) without success (lots of missing identifiers, "i
oops, I didn't complete the first email.
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
>
> --- "Porell, Chris" <[EMAIL PROTECTED]> wrote:
>
> > My question to the list: Do any companies that offer professional support
> > services stand out from the rest? Please let me know who you are us
All very good points, thank you!
We have an immediate obstacle which we need assistance with, (I'll be posing
this issue to one of the lists!) but generally we will need to maintain 24/7
support as a matter of company policy. Any service located in the US should
be fine since this functional area
--- "Porell, Chris" <[EMAIL PROTECTED]> wrote:
> My question to the list: Do any companies that offer professional support
> services stand out from the rest? Please let me know who you are using.
The only indication that I can give, to help answer your question would be to
look at the
compan
Steve Crawford wrote:
> So my mental-model is utterly and completely wrong. My assumption was
> that since a full vacuum requires an access exclusive lock, it would do
> the intelligent and efficient thing which would be to first compact the
> table and then recreate the indexes.
Right, it doesn'
Porell, Chris wrote:
My question to the list: Do any companies that offer professional support
services stand out from the rest? Please let me know who you are using.
Many of the people who reply will be offering services, so it's
difficult to be unbiased. Without knowing what your requirem
Martijn van Oosterhout wrote:
> On Wed, Apr 25, 2007 at 09:36:35AM -0700, Steve Crawford wrote:
>> Hmmm, why would cluster be faster?
>
> Basically, vacuum full moves tuples from the end to the beginning of a
> table so it can compact the table. In the process it needs to update
> all the indexes
[EMAIL PROTECTED] writes:
> I am looking for the kind code for STATISTIC_KIND GEOMETRY to calculate
> the selectivity/stats for geometry type (st_geometry).
Presumably, the PostGIS people would be the ones to ask.
regards, tom lane
---(end of broa
Richard Huxton <[EMAIL PROTECTED]> writes:
> Ah, fair enough. I *am* right in thinking that trivial SQL functions
> will have their expressions inlined though?
Yes.
regards, tom lane
---(end of broadcast)---
TIP 5: don't fo
Hi everyone,
newbie here...
I have a need to get paid support services for a new postgres implemetation.
I've looked at some of the companies listed at www.postgresql.org that offer
professional services.
I've perused some of the mailing list archived, but I can't seem to find the
info I need.
Tom Lane wrote:
Richard Huxton <[EMAIL PROTECTED]> writes:
I must say I thought recent versions of PG delayed planning the query
until first call though.
No, you're thinking of parameterized queries sent through the FE/BE
protocol. Functions still plan without any assumptions about parameter
Owen Hartnett wrote:
I want to "freeze" a snapshot of the database every year (think of end
of year tax records). However, I want this frozen version (and all the
previous frozen versions) available to the database user as read-only.
My thinking is to copy the entire public schema (which is w
Richard Huxton <[EMAIL PROTECTED]> writes:
> I must say I thought recent versions of PG delayed planning the query
> until first call though.
No, you're thinking of parameterized queries sent through the FE/BE
protocol. Functions still plan without any assumptions about parameter
values.
On Wed, Apr 25, 2007 at 09:36:35AM -0700, Steve Crawford wrote:
> Hmmm, why would cluster be faster?
Basically, vacuum full moves tuples from the end to the beginning of a
table so it can compact the table. In the process it needs to update
all the indexes too. So you save heap space but it tends
I'm doing it form the application layer and I don't think it can be
done in the database layer, how the trigger will figure out which user
is doing the query?, It's the same problem you are trying to solve!
Duh! That is what happens when you start having high levels of caffeinne in
your blood
"Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes:
> Hi Manuel,
>
>> each time the user sends a request I do more or less the following:
>
> Could a trigger be used to implement this ? Or are you doing this from the
> application layer?
I'm doing it form the application layer and I don't thin
Hi Manuel,
each time the user sends a request I do more or less
the following:
Could a trigger be used to implement this ? Or are you doing this from the
application layer? My problem is that, like Til, I don't have full control
over my request cycle as I'm over a very high-level framework (Ac
Hi:
I'm a new user of Postgresql (8.2.3), and I'm very happy with both
the performance and operation of the system. My compliments to you
the many authors who keep this database running and useful.
My question is:
I want to "freeze" a snapshot of the database every year (think of
end of y
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> I wonder, though, if you set maintenance_work_mem too high and are
> causing the OS to swap?
AFAIR, vacuum full pays no attention to maintenance_work_mem anyway.
If the data it needs doesn't fit in memory, you lose ...
regards,
* Manuel Sugawara <[EMAIL PROTECTED]> [20070425 17:57]:
> I think you can use a plpgsql function with execute. For instance, if
> the name of your temp table is current_user_id the function will be
> something like:
>
> create function get_current_user_id() returns int as $
> You could try CLUSTER instead of VACUUM FULL, as I think it should be
> faster. And the indexes will be devoid of any bloat, which will be a
> nice side effect.
>
> I wonder, though, if you set maintenance_work_mem too high and are
> causing the OS to swap?
>
Hmmm, why would cluster be faster
Steve Crawford wrote:
> I'm in the process of archiving data on one of my PG machines. After
> backing up the data, I delete the old records and then run a "vacuum
> full" on each table.
>
> I'm vacuuming the first table now and it is taking much longer than I
> expected (I'm now past the 2-hour m
Tilmann Singer <[EMAIL PROTECTED]> writes:
> Can I define a view which references a table in a way so that it will
> use a temporary table of the same name if it exists, otherwise the
> permanent table with that name?
I think you can use a plpgsql function with execute. For instance, if
the name
am Wed, dem 25.04.2007, um 19:25:46 +0400 mailte Sergey Karin folgendes:
> vka7=# insert into style_type_object values(1, 2, false, 0, 0);
> ERROR: insert or update on table "style_type_object" violates foreign key
> constraint "fk_id_style"
> DETAIL: Key (id_style)=(2) is not present in table "
I'm in the process of archiving data on one of my PG machines. After
backing up the data, I delete the old records and then run a "vacuum
full" on each table.
I'm vacuuming the first table now and it is taking much longer than I
expected (I'm now past the 2-hour mark). Some info:
Version: 8.1.2
O
I currently am using a normal system like the one you suggest, in
which every user puts their data into a single schema, and uses keys
to keep things separate. The problem comes in database upgrades.
They're not common, but as I ramp up the number of users, it becomes
increasingly infeasibl
* Manuel Sugawara <[EMAIL PROTECTED]> [20070425 17:14]:
> > So the view will reference the original table and not the temporary
> > table. Is there a way to achieve this kind of transaction local
> > setting? A transaction based solution would give more security in a
>
hello,
Thanks for your reply.
will that be possible for me to get the simple bitmapindex
implementation code now.
i went through the ondiskimplementation code i cant understand that
properply.
i want a simplified implementation of that.could you kindly help me
out.
Sangeetha.K.S.
On Tue, 2007-04-24 at 11:31 +0200, Alexander Staubo wrote:
> On 4/24/07, Mageshwaran <[EMAIL PROTECTED]> wrote:
> > I want to do replication using WAL , please tell the methods by which
> > log shipping is done ie moving the wal files to slaves and executing it.
>
> Not possible at the moment: the
Hi, All!
I have the tables as defined:
create table style
(
ID_STYLE INT4 not null,
STYLE_STRING VARCHAR not null,
constraint PK_STYLE primary key (ID_STYLE)
);
create table style_type_object
(
ID_TYPE_OBJECT INT4 not null,
ID_STY
hello sir,
does postgre sql support bitmap indexing for indexing the
datatables.
will that be possible to get the source of that.
Sangeetha.K.S
Tilmann Singer <[EMAIL PROTECTED]> writes:
> So the view will reference the original table and not the temporary
> table. Is there a way to achieve this kind of transaction local
> setting? A transaction based solution would give more security in a
> situation where a web app server uses a connect
On Wed, Apr 25, 2007 at 04:50:46PM +0200, [EMAIL PROTECTED] wrote:
> Richard Huxton wrote:
> >[EMAIL PROTECTED] wrote:
> >>What other variable (which are sometimes there, sometimes not) reasons
> >>there can be pg_connect to fail?
> >
> >What result-code/error do you get? What do your logs show?
>
"Marcelo de Moraes Serpa" <[EMAIL PROTECTED]> writes:
> I'm sorry Manuel, but after some time trying to fully understand your
> approach, I think I really don't have the required elements to do so.
>
> How do you pass your application's usename to this table? Or you don't keep
> the username at al
Richard Huxton wrote:
> Did you try pg_last_error()?
No. Will try now.
> Are you logging connection attempts/failures? Details in the manuals.
Understood.
Thank you very much!
Iv
---(end of broadcast)---
TIP 1: if posting/reading through Usenet,
On 25/04/2007 15:50, [EMAIL PROTECTED] wrote:
Thought of using pg_result_error - but it seems applicable only to
queries (i.e. with pg_query or pg_execute). How can I get an error code?
pg_last_error()
http://www.php.net/manual/en/function.pg-last-error.php
Ray.
Please don't cross-post to multiple mailing lists. And pgsql-hackers is
not the correct list for basic usage questions. And long end-of-mail
disclaimers are not generally appreciated.
Mageshwaran wrote:
Any body tell me how to kill a long running query in postgresql, is
there any statement to
[EMAIL PROTECTED] wrote:
Richard Huxton wrote:
[EMAIL PROTECTED] wrote:
What other variable (which are sometimes there, sometimes not)
reasons there can be pg_connect to fail?
What result-code/error do you get? What do your logs show?
I have -
$connection = pg_connect("$host $db $user $pas
Mageshwaran wrote:
Hi ,
Any body tell me how to kill a long running query in postgresql, is
there any statement to kill a query, and also tell me how to log slow
queries to a log file.
First. please do not cross-post like this. Pick the correct list and use it.
Second, this query definite
On Tue, 2007-04-24 at 12:57 -0500, Michael Nolan wrote:
> Can WAL files be used to create/update a warm standby on a different
> minor version of PostgreSQL (eg, using files from a server running
> 8.2.3 on an 8.2.4 server, or vice-versa?)
>
> I suspect this is a FAQ, but I didn't see it in the do
On 4/25/07, Mageshwaran <[EMAIL PROTECTED]> wrote:
Hi ,
Any body tell me how to kill a long running query in postgresql, is
there any statement to kill a query, and also tell me how to log slow
queries to a log file.
Regards
J Mageshwaran
See if this helps:
http://archives.postgresql.org/pg
Mageshwaran wrote:
Hi ,
Any body tell me how to kill a long running query in postgresql, is
there any statement to kill a query, and also tell me how to log slow
queries to a log file.
Oh, and please don't post to several lists at once - this clearly isn't
a hacker-related question.
--
Ri
Richard Huxton wrote:
[EMAIL PROTECTED] wrote:
What other variable (which are sometimes there, sometimes not) reasons
there can be pg_connect to fail?
What result-code/error do you get? What do your logs show?
I have -
$connection = pg_connect("$host $db $user $pass");
When I get the error
am Wed, dem 25.04.2007, um 20:03:37 +0530 mailte Mageshwaran folgendes:
> Hi ,
> Any body tell me how to kill a long running query in postgresql, is
> there any statement to kill a query, and also tell me how to log slow
> queries to a log file.
pg_cancel_backend(pid int) to kill. You need to k
Scott Schulthess wrote:
Hey Ya'll,
I'm a little puzzled by the speed of the stored procedures I am writing.
Here is the query alone in pgAdmin
select distinct featuretype from gnis_placenames where state='CT'
TIME: 312+16ms
Here is a stored procedure
create or replace function getfeature
On Thu, 2007-04-19 at 15:48 -0500, Thomas F. O'Connell wrote:
> "If we take a backup of the standby server's files while it is
> following logs shipped from the primary, we will be able to reload
> that data and restart the standby's recovery process from the last
> restart point. We no longer nee
You can try this one.
SELECT
table2.*
FROM
(SELECT string_to_array(ids, ', ') FROM table1 WHERE name =
'Peter') AS a(a),
(SELECT generate_series(1,array_upper(string_to_array(ids,
', '),1)+1,1)FROM table1 WHERE name = 'Peter') c(n),
[EMAIL PROTECTED] wrote:
What other variable (which are sometimes there, sometimes not) reasons
there can be pg_connect to fail?
What result-code/error do you get? What do your logs show?
--
Richard Huxton
Archonet Ltd
---(end of broadcast)-
Hi ,
Any body tell me how to kill a long running query in postgresql, is
there any statement to kill a query, and also tell me how to log slow
queries to a log file.
Regards
J Mageshwaran
** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to
* Manuel Sugawara <[EMAIL PROTECTED]> [20070425 00:17]:
> I solved the problem using a C program and keeping all the information
> in the database, that means, users, passwords and ``sessions''. Each
> time a user opens a session the system register it in a table that
Hey Ya'll,
I'm a little puzzled by the speed of the stored procedures I am writing.
Here is the query alone in pgAdmin
select distinct featuretype from gnis_placenames where state='CT'
TIME: 312+16ms
Here is a stored procedure
create or replace function getfeaturetypes(text) r
I'm sorry Manuel, but after some time trying to fully understand your
approach, I think I really don't have the required elements to do so.
How do you pass your application's usename to this table? Or you don't keep
the username at all?
Could you give a more concrete example? Maybe showing the s
Hello,
we migrated a php code from FreeBSD 5.x, PostgreSQL 8.x and php 4.x - to
the latest versions of these, keeping the configuration options. Now
pg_connect started to fail on irregular intervals for no obvious reason.
Before we had a problem with the number of connections, but we monitored
Hi Manuel, just a quick question: What C libraries do I need to compile this
function? Or better: Where can I find a reference manual about db stored
procedures written in C for PostgreSQL?
Thanks!
On 4/24/07, Manuel Sugawara <[EMAIL PROTECTED]> wrote:
"Marcelo de Moraes Serpa" <[EMAIL PROTECT
Hey guys, I really appreaciate your help, thank you very much for your time.
@Manuel: What a comprehensive solution! Thanks a lot for that :)
@Joris: That would be a simpler althernative, I will try it out too!
Marcelo.
On 4/24/07, Joris Dobbelsteen <[EMAIL PROTECTED]> wrote:
-
I have a math question and a benchmark question and I'm not sure how
to benchmark it.
What I'm trying to do is use pgsql as a bayes token store for a spam
filter I'm writing.
In doing this I have a data structure with index keys and two integer
fields 'h_msgs' and 's_msgs' for each token an
Is there a tutorial on this stuff?
I did check the Really Fine Manual and they said explain plans are
beyond the scope RTFM.
On Apr 22, 2007, at 10:36 AM, A. Kretschmer wrote:
am Sun, dem 22.04.2007, um 9:43:32 -0400 mailte Tom Allison
folgendes:
"Seq Scan on" - is this just a FULL TA
name| ids
-
Peter| 2, 3, 4, 5
Jack| 100, 34, 3
Both name and ids are in text format.
IF you really do not want to use a link table (user_id, flag_id), you
could use an array of ints instead of a string...
---(end of broadcast)-
72 matches
Mail list logo