Hi,
I have the following statement in a function.
UPDATE orderseq
SET orderseq_number = (orderseq_number + 1)
WHERE (orderseq_name='InvcNumber');
All it does is update a single record by incrementing a value (int).
But it never completes. This has to be some sort of bug. Anyone ha
I have tried to use a user defined data type I created within a schema.
But I could not figure it out.
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF xchromasun.weekly_mpr AS
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF "xchromasu
On 06/11/2012 06:53 AM, Igor Neyman wrote:
-Original Message-
From: John Fabiani [mailto:jo...@jfcomputer.com]
Sent: Thursday, June 07, 2012 7:18 PM
To: pgsql-sql@postgresql.org
Subject: using ordinal_position
I'm attempting to retrieve data using a select statement without
kn
I'm attempting to retrieve data using a select statement without knowing
the column names. I know the ordinal position but not the name of the
column (happens to be a date::text and I have 13 fields).
Below provides the name of the column in position 3:
select column_name from (select column_n
Hi,
In python when I create a method/function is set a default value for a
passed value if one is not provided.
def foo(self, event = None):
In the above function if the second value is not passed a value of None
is used as the default.
Is this possible with plpgsql???
Johnf
--
Sent via p
nism but also introduces some
> lag time. Pick your poison.
>
> -steve
>
> On Sat, May 12, 2012 at 7:28 AM, John Fabiani wrote:
> > I need to maintain a sync-ed table across several databases. For
> > example I have a customer table in 5 databases. If a user of any of
>
I need to maintain a sync-ed table across several databases. For example I
have a customer table in 5 databases. If a user of any of the databases
inserts a new customer I need to insert the new record into the other four
databases. But question is updates and deletes.
I can use a trigger an
On Monday, April 23, 2012 04:52:25 PM Andreas Kretschmer wrote:
> John Fabiani wrote:
> > Hi,
> > In my app it is possible to login as one name and use a different name
> > to
> > login to postgres.
> >
> > Is it possible to get the actual OS login name u
Hi,
In my app it is possible to login as one name and use a different name to
login to postgres.
Is it possible to get the actual OS login name using plsql.
Johnf
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mai
On Friday, March 23, 2012 04:00:56 PM Rob Sargent wrote:
> And I believe Jonathon confirmed that you could, with the caveat that
> you must select from within the transaction. I don't see that you've
> laid that out your connection stategy so ymmv.
I didn't see Jonathon response? Must be a dire
o long. Potential concurrency issues
> etc.
>
> On 03/23/2012 03:40 PM, Jonathan S. Katz wrote:
> > On Mar 23, 2012, at 5:33 PM, John Fabiani wrote:
> >> I start a transaction.
> >> Begin
> >>
> >> Then I insert a lot of data - let's say two hundred
Hi,
I know this is a newbie question but I have never had the need to do the
following.
I start a transaction.
Begin
Then I insert a lot of data - let's say two hundred rows.
Now I need to read the same data (so the user can review).
If the user thinks all is right then
commit.
Can I read th
e:
> Hello
>
> maybe this article helps
> http://stackoverflow.com/questions/3002499/postgresql-crosstab-query
>
> there are more ways
>
> Regards
>
> Pavel Stehule
>
> 2012/3/12 John Fabiani :
> > Hi,
> > I don't know if it because I'm as
Hi,
I don't know if it because I'm as sick as dog or I'm just a plain idiot - most
likely a little of both.
Here is my table
week_of date,
item_number text,
planned_demand integer.
I have
week_ofitem_number planned
2012-02-125200
2012-02-195
Hi Folks,
I have one that I need your advise on how to construct.
I have the need to create a series of dates starting from a Sunday - one week
apart.
(select ((date_trunc('week', '2012-02-12'::date)::date) +(i+6)) as week_date
from
generate_series(0,84,7) i) as foo
that gives a table of sun
sprüngliche Nachricht-
> Von: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
> Im Auftrag von John Fabiani Gesendet: Freitag, 24. Februar 2012 09:39
> An: pgsql-sql@postgresql.org
> Betreff: Re: [SQL] crosstab help
>
> That worked! However, I need the actual
> Von: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
> Im Auftrag von John Fabiani Gesendet: Freitag, 24. Februar 2012 09:11
> An: pgsql-sql@postgresql.org
> Betreff: [SQL] crosstab help
>
> I have a simple table
> item_number week_of
I have a simple table
item_number week_of planned_qoh
-- -- --
5 2012-02-05 30
5 2012-02-12 40
5 2012-02-19 50
where
item_number text
week_of date
planned
select
substring(t1.called_number from t2.offset),
t1.called_number
from
calls_join as t1,
john_prefix as t2
where
strpos(t1.called_number, t2.prefix) = '1'
order by length(t2.prefix) desc limit '1' ;
I'm having trouble using this as a sub-select in an UPDATE. Most of the
On Monday, February 13, 2012 04:50:47 PM Andreas Kretschmer wrote:
> John Fabiani wrote:
> > Hi,
> > I have read a few articles and I'm not sure if it's me or the authors
> > but I do not believe my question was answered.
> >
> > If I have table that h
Hi,
I have read a few articles and I'm not sure if it's me or the authors but I do
not believe my question was answered.
If I have table that has a PK and a FK - will the planner use the FK just same
as it would use the PK? IOW's is a FK also an index used by the planner?
I have a lagacy tab
I seem to have a problem with a specific query:
The inside query seems to work on it's own:
select prefix
from john_prefix
where strpos(jpt_test.number,john_prefix.prefix) = '1'
order by char_length(john_prefix.prefix) desc limit 1
but when I exec
26 PM, David Johnston wrote:
On Jan 12, 2012, at 23:31, John Tuliao <mailto:jptul...@eglobalreach.net>> wrote:
Hi,
I've been working on this for quite awhile now and don't seem to get
the proper query.
I have basically 4 tables.
1. Table john_test contains the number
Hi,
I've been working on this for quite awhile now and don't seem to get the
proper query.
I have basically 4 tables.
1. Table john_test contains the numbers of the calls.
2. Table john_country contains the country with prefix.
3. Table john_clients contains the clients and their sub_id's
On 12/30/2011 7:31 PM, David Johnston wrote:
On Dec 30, 2011, at 21:53, John Poole wrote:
I am trying to create a custom data type for phone numbers where
I have a primary phone number and then an array of additional
phone numbers qualified by certain types.
Below is a set of SQL commands
an someone provide me an example of how to insert one or more
records into the secondary array component of the type or provide
some light on creating a custom type that would hold two fields:
1) a single type
2) an array of types (this field may be null)
Thank you.
John Poole
===
On Friday, December 30, 2011 06:26:19 AM John Fabiani wrote:
> Hi,
> I recall somewhere I saw a simple plpgsql function that returned a table
> with more than one record that did not use a defined type or a temp table (
> at least I think I did). Is it possible to create such a f
Hi,
I recall somewhere I saw a simple plpgsql function that returned a table with
more than one record that did not use a defined type or a temp table ( at
least I think I did). Is it possible to create such a function that will
return more than one record and not require a record type or temp
As always I respect your insights - Adrian. I do understand what I did wrong
in my first attempt at getting my statement to work. But it is either over my
head or there is something missing. Where is the "from" in
select now()?
I have been using similar SQL statements for years. I never ques
nerate_series(0,84,7)
i ) as foo
The above works!
Johnf
On Friday, December 16, 2011 02:46:18 AM John Fabiani wrote:
> Actually what would the "from" be - this could be a newbie issue here?
> Neither statement requires a "from" because neither of the statements uses
Friday, December 16, 2011 01:30:53 AM Misa Simic wrote:
> It is not totally clear to me what are u trying to do... But in second
> query it seems there is missing "from"
>
> It is as
>
> SELECT week-date::date AS week-date WHERE week-date in (subquery which
> h
Hi,
I am attempting (without success) use the generated series of dates that come
from:
select (cast(date_trunc('week', '2011-11-20'::date ) as date) + (i+6)) as
week_date from generate_series(0,84,7) i
in a function.
select function_name(integer, date); -- function returns a numeric
This do
On Tuesday, November 15, 2011 08:06:30 am John Fabiani wrote:
> Hi,
> I have need of a statement that updates the sequence but uses a max() to
> find the number.
>
> alter sequence somename restart with (select max(pk) from sometable).
>
> I need this for automating
On Tuesday, November 15, 2011 07:46:19 pm Scott Marlowe wrote:
> On Tue, Nov 15, 2011 at 5:33 PM, Samuel Gendler
>
> wrote:
> > On Tue, Nov 15, 2011 at 4:28 PM, John Fabiani
wrote:
> >> On Tuesday, November 15, 2011 08:33:54 am Richard Broersma wrote:
> >>
On Tuesday, November 15, 2011 08:33:54 am Richard Broersma wrote:
> On Tue, Nov 15, 2011 at 8:06 AM, John Fabiani wrote:
> > alter sequence somename restart with (select max(pk) from sometable).
> >
> > I need this for automating an ETL (using pentaho).
>
> http://
Hi,
I have need of a statement that updates the sequence but uses a max() to find
the number.
alter sequence somename restart with (select max(pk) from sometable).
I need this for automating an ETL (using pentaho).
Postgres 8.4
Thanks in advance,
Johnf
--
Sent via pgsql-sql mailing list (pgs
On Friday, November 04, 2011 11:06:37 am Richard Huxton wrote:
> On 04/11/11 15:26, John Fabiani wrote:
> > On Friday, November 04, 2011 07:38:29 am John Fabiani wrote:
> >> Hi,
> >> I just discovered that I can use $$string$$ to account for the problem
> >>
On Friday, November 04, 2011 09:05:19 am David Johnston wrote:
> On Nov 4, 2011, at 11:26, John Fabiani wrote:
> > On Friday, November 04, 2011 07:38:29 am John Fabiani wrote:
> >> Hi,
> >> I just discovered that I can use $$string$$ to account for the problem
> >
On Friday, November 04, 2011 07:38:29 am John Fabiani wrote:
> Hi,
> I just discovered that I can use $$string$$ to account for the problem of
> single quotes in the string (or other strange char's). However, I noticed
> that the table field contained E'string'. I act
Hi,
I just discovered that I can use $$string$$ to account for the problem of
single quotes in the string (or other strange char's). However, I noticed
that the table field contained E'string'. I actually tried to find info on
this but I did not find anything.
Could someone explain what it
On Thursday, September 22, 2011 08:14:58 pm David Johnston wrote:
> On Sep 22, 2011, at 22:49, John Fabiani wrote:
> > Hi,
> > I need a little help understanding how to attack this problem.
> >
> > I need to find the max(date) of a field but I need that value later in
Hi,
I need a little help understanding how to attack this problem.
I need to find the max(date) of a field but I need that value later in my
query.
If I
select max(x.date_field) as special_date from (select date_field) from table
where ...)x
I get one row and column.
But now I want to use
On Tuesday, July 05, 2011 01:11:11 pm Kevin Crain wrote:
> You don't need a loop there. Assuming your order id field is of type
> varchar you can just build the first part of your string and then do a
> count to get the last part using a LIKE comparison:
>
> select count(id_order) + 1 from somet
Hi,
I have a special need to create a sequence like function.
"O-20110704 -2" which is
"O" for order (there are other types)
"20110704" is for July 4, 2011
'2' the second order of the day for July 4, 2011
I of course can get the type and date. What I don't know is how to get is the
last numb
On Thursday, June 23, 2011 08:44:49 am John Fabiani wrote:
> Hi,
> I have a SELECT statement that is using the regexp_split_to_table function
> as follows:
>
> ... and fk_topic in (select regexp_split_to_table(eligible_topics,
> ',')::int from escourse)
>
> N
Hi,
I have a SELECT statement that is using the regexp_split_to_table function as
follows:
... and fk_topic in (select regexp_split_to_table(eligible_topics, ',')::int
from escourse)
Normally there are 1 to 3 values in eligible_topics as
46,50,43.
The problem is the performance is terrible an
On Tuesday, May 10, 2011 10:30:58 am Richard Broersma wrote:
> On Tue, May 10, 2011 at 10:24 AM, John Fabiani wrote:
> >> spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
> >> '2011-04-30'::DATE;
> >> ?column?
> &
On Tuesday, May 10, 2011 10:16:21 am Richard Broersma wrote:
> On Tue, May 10, 2011 at 9:48 AM, John Fabiani wrote:
> > Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date
> > With the above where will the NULL's be selected
>
&
Hi,
Maybe this is a dumb question but if I have a date field that contains a NULL
will it show up when I ask for a where date range for the same date field.
Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date
With the above where will the NULL's be selected
I ask because I wa
On Tuesday, April 05, 2011 07:44:51 am Adrian Klaver wrote:
> On Tuesday, April 05, 2011 7:27:24 am John Fabiani wrote:
> > Hi,
> > I would like to have a simple way to retrieve information for a field
> > name. By that I mean have some SQL select that will return all the
&g
Hi,
I would like to have a simple way to retrieve information for a field name.
By that I mean have some SQL select that will return all the tables a field
name exist within a database. I did not find anything with google but of
course google depends on the search string.
Thanks in advance,
J
tly the problem is - I am waiting for a
> supervisor to call me back and I'd like to lead him to the answer so he can
> fix the problem.
I think you are right -- they likely have some one's stuff in the template
database. On your account that does not have the problem -- is i
Hi,
I would have thought that there would be a simple built-in function that would
escape the quotes as ('D' Andes') to ('D\' Andes'). But I did not see
anything?
I am I wrong?
Johnf
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://w
On Friday, January 28, 2011 07:46:37 pm Jasen Betts wrote:
> On 2011-01-29, John Fabiani wrote:
> > Hi guys,
> > I trying to return a 0.00 from a function it there are no records found
> > else return the amount.
> >
> > select sum(aropen_paid) into
Hi guys,
I trying to return a 0.00 from a function it there are no records found else
return the amount.
create or replace function danmeans_getpayments(text)
returns numeric as
$BODY$
declare
invoice_num ALIAS FOR $1;
_paidamt numeric;
BEGIN
select sum(aropen_paid) into _paidamt FROM pub
On Wednesday, December 01, 2010 01:13:52 am Lee Hachadoorian wrote:
> John,
>
> Would probably be useful to see the results of the command, but a couple
> of things are immediately obvious.
>
> First, Postgres requires identifiers to start with a letter or
> underscore.
Hi,
How do I load a Census shp file into an exist database? I believe I have
postGIS install and now I want to load the US counties shp file.
the following does not appear to work
shp2pgsql -s 4269 -I -W latin1 tl_2008_us_county.shp 2008_us_county | psql
Plus I don't know what it does!
Johnf
gt; > Select cl.pkid, cl.depart, cl.sessionid, cl.instrid,
> > cl.classseq,(select facility from esloc where esloc.pkid = cl.locationid)
> > as
> > facility, cl.schedule from esclass cl where cl.pkid in (14507,14508)
> >
> > 2010/11/24 John Fabiani
> >
> >
Hi,
I have a strange issue that is mostly likely me not understanding something.
I always thought that an insert statement would accept any select statement.
I'm guessing I am wrong.
I have created a temporary table ("tempclass") that is exact match to an
existing table ('esclass').
When I
groups.
John
- Original Message -
From: Oliveiros d'Azevedo Cristina
To: John Lister ; pgsql-sql@postgresql.org
Sent: Wednesday, November 17, 2010 4:09 PM
Subject: Re: [SQL] obtaining difference between minimum value and next in size
Hi, John.
I am not familiar wit
then I would like the following returned
product_id, difference
2, .04 (10.05-10.01)
3, 1.97 (11.42-9.45)
,etc
Any ideas?
Thanks
John
--
Got needs? Get Goblin'! - http://www.pricegoblin.co.uk/
On Saturday, August 28, 2010 08:35:07 am Tom Lane wrote:
> John Fabiani writes:
> > I have program that loops though several thousands of records. The loop
> > contains a select statement that confirms that I don't have a dup and
> > then inserts a record into a d
Hi,
In general what are the causes of SQL select statement slow downs - other than
the size of the data? I realize this is a broad question but read on please.
Here's where I'm coming from:
I have program that loops though several thousands of records. The loop
contains a select statement tha
Could someone provide a link or help me understand what is required to get
function debugging working. I haven't started yet and I thought it best to
check with you guys before I start. Just the little I have researched has me
worried and I do not want to mess up my current install.
I'm on op
than you might expect from a clock
> conditioned with ntpd. Is it a VM or is there something going on that
> would stop or suspend your system?
There is certainly something wrong there.
--
John Hasler
jhas...@newsguy.com
Elmwood, WI USA
--
Sent via pgsql-sql mailing list (pgsql-sql@post
How does PostgreSQL react to time being stepped at bootup? My Chrony
NTP package might cause it to do so on rare occasions when the hardware
clock is way off. This would only happen during bootup.
--
John Hasler
jhas...@newsguy.com
Elmwood, WI USA
--
Sent via pgsql-sql mailing list (pgsql
complementary action to regexp_split_to_table.
Grouping by summing numerical fields seems to be straightforward, but
grouping by concatenating text fields escapes my search of the
documentation.
Thanking you for your patience,
John
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make
On Wednesday 07 July 2010 03:14:40 pm Justin Graf wrote:
> I would be looking at the log files for the Inserts into that table as a
> means to track down what is the cause. If there are no log files or
> don't have enough detail, crank up the logging level and wait for it to
> happen again???
Th
; Search the logs to see what is calling nextval('My_Sequence')
>
> You may need to turn up logging to find it.
>
> On 7/7/2010 2:59 PM, John wrote:
> > I am the only developer, DBA etc.. for a small project. Today (yesterday
> > was everything was perfect) man
I am the only developer, DBA etc.. for a small project. Today (yesterday was
everything was perfect) many of the sequence numbers fell behind what is the
actual PK value. For example the invoice PK sequence current value = 1056
but the table PK was 1071. Nobody (other than myself) knows how
On Friday 11 June 2010 07:37:29 am Andreas Kretschmer wrote:
> John wrote:
> > Hi,
> > I'd like to learn the use of window functions and did not find a tutorial
> > using google ("postgres window function tutorial"). I'm hoping someone
> > has a lin
Hi,
I'd like to learn the use of window functions and did not find a tutorial
using google ("postgres window function tutorial"). I'm hoping someone has a
link.
Johnf
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/
st/datatype of the columns returned by the function).
>
> Doug
>
>
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org
> [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of John Sent: Thursday,
> June 10, 2010 4:22 AM
> To: pgsql-sql@postgresql.org
> Sub
Hi,
I have a piece of python code that excutes a SQL statement:
apitempCur.execute("select * from jfcs_balancedue('%s') f(enrolleeid varchar,
course_cost decimal, paid_amt decimal)" % (enrollIds,));
The "enrollids" is a list of primary keys and the "jfcs_balancedue" is a user
defined function.
word.
SELECT to_tsvector('simple', 'Andy andy The the in out');
to_tsvector
-
'in':5 'out':6 'the':3,4 'andy':1,2
(1 row)
John
On Apr 29, 2010, at 4:01 PM, Tom Lane wrote:
"sandeep prakash d
Wow thanks to all that replied - you folks are correct. The "_p" and the
others are vars.
_p RECORD;
I won't forget that one for a long time (however, I do drink :-))
Johnf
On Friday 09 April 2010 10:32:51 am Pavel Stehule wrote:
> Hello
>
> 2010/4/9 John :
>
Hi,
I am reviewing a function written by some xTuple guys. What is interesting
about it is it uses the "INTO" statement like
select something into _p from sometable where somecriteria.
The function contiunes and uses the data retreived
_p.somefield_name
And then the function ends.
Ok my que
doc's on dollar quoting.
John
On Mar 24, 2010, at 8:13 PM, Josh Kupershmidt wrote:
On Wed, Mar 24, 2010 at 2:38 PM, John Gage wrote:
In going through the arcana of string functions, I have come across
the
following series of selects that contain, for me, a mysterious "$re
$".
n this I get:
regexp_matches
--
I have not been able to find out what it all means. Forgive me for my
blindness.
John
P.S. The author of the statements is "alexk" at Command Prompt. They are
test statements against Postgres' string functions.
been able to find out what it all means. Forgive me for my
blindness.
John
P.S. The author of the statements is "alexk" at Command Prompt. They are
test statements against Postgres' string functions.
I, nead to capture the IP number from the PC how is running the script
"update TABLE1 set campo1 = 123 where ...; "
Can someone help me please?
--
John Evan Dizaro -
Fone: (41) -0303
Fone: (41) 9243-3240
Rua: Alferes Poli Curitiba - PR - Brasil
Hi,
I am working with a view that has a "_INSERT" rule. I'm wondering if there is
a way to determine what the curval() of the PK (serial type) after an insert
occurs.
Given the name of the view I'd like to determine the sequence associated with
the view's PK. Actually, I wonder if it is ev
s.pdf,
http://wiki.postgresql.org/wiki/PgCon_2008_Developer_Meeting#Partitioning_Roadmap
which mention improvements to partitioning, but I can't find any info if
these have been acted on.
Just curious as things like pushing limits down to the sub queries would
be a great feature, etc
Ch
#x27; as the first result (ok not a word, but that is a
different issue) but if i do
select * from words where word <'.' order by word desc limit 10
I get '/...' as the first result, I would expect '', this doesn't seem
consistent.
I'm obviously m
ints are ignored, but
this doesn't seem overly complicated.
Am i doing something wrong or is there another better way to do this
Thanks
John
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Michael Gould wrote:
Gary,
Based on what I read it wouldn't handle cases where the result should be
MacDonald from macdonald. There are other cases such as the sentence below
I've looked at rationalising names in this manner before, and found
that, depending on the individual, both Macdonal
On Monday 26 October 2009 04:41:49 pm John wrote:
> Below is a SQL statement that was created to retreive the primary key , and
> column names and data types for a table name and a schema. The problem is
> that is works very well if I only use the 'public' schema. But it does
Below is a SQL statement that was created to retreive the primary key , and
column names and data types for a table name and a schema. The problem is
that is works very well if I only use the 'public' schema. But it does not
work if I use a 'system' schema I created (owned my me). The offendi
On Friday 07 August 2009 02:50:48 am Leo Mannhart wrote:
> John wrote:
> [snip]
>
> > I'm sorry I was attempting to simplify the problem. I will attempt to
> > provide more info:
> >
> > OVERVIEW:
> > "mytable" contains the dates of the
On Thursday 06 August 2009 06:42:34 am Leo Mannhart wrote:
> John wrote:
> > mytable
> > pkid
> > class_date.
> > sessionid
> >
> > select * from mytable
> > 1 2009/01/01 2101
> > 2 2009/01/02 2101
> >
> > I would like an SQ
On Wednesday 05 August 2009 10:21:08 pm A. Kretschmer wrote:
> In response to John :
> > mytable
> > pkid
> > class_date.
> > sessionid
> >
> > select * from mytable
> > 1 2009/01/01 2101
> > 2 2009/01/02 2101
> >
> > I
mytable
pkid
class_date.
sessionid
select * from mytable
1 2009/01/01 2101
2 2009/01/02 2101
I would like an SQL that would produce
newtable
pkid,
class_date1,
class_date2,
sessionid1,
sessionid2
Select * from newtable
1 2009/01/01 2009/01/02 2101 2101
I have a list of classes that is perfect
Can somebody tell me please where i can find the PgAdmin Hotkey like
Ctrl+SPACEBAR and others??
Tanks for all.
--
John Evan Dizaro -
Fone: (41) -0303
Fone: (41) 9243-3240
Rua: Alferes Poli Curitiba - PR - Brasil
"John Lister" writes:
Am I right in assuming the planner thinks a sequential scan is quicker
than 10k index hits, would tweaking the costs fix this or would i be
better updating the stats for the product_id and manufacturer_id fields?
AFAICT the planner did exactly the right t
Doing the following query
select distinct m.id, m.name
from manufacturer_manufacturer m
join product_product p on (p.manufacturer_id=m.id)
join retailer_offer o on (o.product_id=p.id)
where o.retailer_id=XXX and o.active
results in one of 2 query plans depending upon the v
Hi Nicholas,
The query is across database query. dblink is needed for that task.
Hope it helps,
John
On Thu, Apr 30, 2009 at 3:07 PM, Edward W. Rouse wrote:
> Can’t you use this?
>
>
>
> select name from database2.sr_1 where name not in (select name from
> database2.pr_1
ction test ()
returns void as $$
declare
rec record;
begin
for rec in select * from whatever loop
insert into some_table values (rec.*);
end loop;
end;
$$ language plpgsql;
John DeSoi, Ph.D.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.or
CASE might work for you.
http://www.postgresql.org/docs/8.3/interactive/functions-conditional.html
John DeSoi, Ph.D.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
tblA.Id=tblB.Id
Any advice? Any input would be much appreciated.
Thanks a lot
John
into" and bypass the
table althogether but i'm guessing this would be slower as the data would need
to be looked up each time the view is used for the subsequent processing steps..
Any thoughts
Thanks
JOHN
--
Got needs? Get Goblin'! - http://www.pricegoblin.co.uk/
1 - 100 of 281 matches
Mail list logo