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
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
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
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
indows/.
>
> Finally, a better list for PostGIS support is
> postgis-us...@postgis.refractions.net.
>
> --Lee
>
> On 12/01/2010 01:06 AM, John Fabiani wrote:
> > Hi,
> > How do I load a Census shp file into an exist database? I believe I have
> > postGIS
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
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
55 matches
Mail list logo