Use the to_number() function to convert text to numbers.
In the manual under functions and operators. The other
function like it is to_date().
--elein
[EMAIL PROTECTED]
On Fri, May 05, 2006 at 02:37:13PM -0700, Kashmira Patel (kupatel) wrote:
> Hi all,
>I have a table with a column o
On Tue, Dec 27, 2005 at 07:25:40PM -0500, Tom Lane wrote:
> elein <[EMAIL PROTECTED]> writes:
> > In 8.0 we get:
>
> >elein=# select 1 in (NULL, 1, 2);
> > ?column?
> >--
> > t
> >(1 row)
>
> >
me not in (
> > select t1.name from t1 limit 261684)
> > --> 0
>
> > What is so magical about 261683?
>
> Most likely, the 261684'th row of t1 has a NULL value of name.
> Many people find the behavior of NOT IN with nulls unintuitive,
> but it's per SQ
I think you want a delete trigger which does your
insert and then follows through with the delete
by returning old.
--elein
[EMAIL PROTECTED]
On Tue, Oct 18, 2005 at 09:43:34PM -0700, efa din wrote:
> This is my rule for doing the delete event. The rule
> can be created. But the prob
There is a write up on these at:
http://www.varlena.com/GeneralBits/82.php
--elein
[EMAIL PROTECTED]Varlena, LLCwww.varlena.com
PostgreSQL Consulting, Support & Training
PostgreSQL General Bits
f you must.
You can't really do it w/o loops or aggregates.
(I wish (hope?) I were wrong about this.)
--elein
On Tue, Aug 17, 2004 at 07:55:11PM -0700, Josh Berkus wrote:
> Folks,
>
> I have a wierd business case. Annoyingly it has to be written in *portable*
> SQL92, wh
to a circle to use the operators,
but it will still tell you whether the smaller polys
are contained within or overlap the larger.
elein
On Tue, Feb 17, 2004 at 07:01:51PM -, David wrote:
> What query would i have to use to search for an item using a polygon as a
> parameter? (i.e a very
Apparently the ::char is cast to varchar and then text?
That explains x || ' ' || x
On Tue, Feb 17, 2004 at 05:07:24PM -0700, scott.marlowe wrote:
> On Tue, 17 Feb 2004, Tom Lane wrote:
>
> > elein <[EMAIL PROTECTED]> writes:
> > > This is an example of the
connection. So any values
stored in it need to be initialized at the appropriate
time *outside* of the first use.
elein
On Sun, Apr 11, 2004 at 12:38:20AM -0400, Greg Stark wrote:
>
> elein <[EMAIL PROTECTED]> writes:
>
> > create or replace function pycounter(integer)
&
This solution will be in Monday's edition of
PostgreSQL General Bits (http://www.varlena.com/GeneralBits).
(In other words, if it doesn't do what you mean, let me know now!)
CREATE TYPE topscores AS
(id integer, query integer, checksum char(32), score integer);
CREATE OR REPLACE FUNCTION tops
"] = 1
return SD["nextno"]
' language 'plpythonu';
And clearly it can be done faster as a little
C function.
elein
On Fri, Apr 09, 2004 at 09:06:39AM -0700, Josh Berkus wrote:
> Rod,
>
> > Something along the lines of the below would accomplish what
A plpython solution is available in Issue #66 of PostgreSQL GeneralBits.
http://www.varlena.com/GeneralBits/66
Let me know if this helps.
elein
On Mon, Apr 05, 2004 at 01:01:39PM -0400, Gavin wrote:
> Hi All, I have been tinkering with a function to log the changes made on
> any column t
ently than cat for text and varchar
because of the different trimming behaviour.
I can do this patch if there is agreement. But
I may not be able to do it immediately.
elein
On Wed, Feb 18, 2004 at 11:58:37PM -0500, Tom Lane wrote:
> elein <[EMAIL PROTECTED]> writes:
> > S
So exactly what is the order of casts that produces
different results with:
'x' || ' ' || 'x' and 'x' || ' '::char15 || 'x'
Are operators being invoked both (text,text)?
I'm trying to understand the precedence that causes
update of the char(n) to text for the operator
"corrupts" the char() value.
elein
On Tue, Feb 17, 2004 at 06:40:49PM -0500, Tom Lane wrote:
> elein <[EMAIL PROTECTED]> writes:
> > This is an example of the problem. It used to expand
> > the middle thing
This is an example of the problem. It used to expand
the middle thing to 15.
elein=# select 'x' || ' '::char(15) || 'x';
?column?
--
xx
(1 row)
On Tue, Feb 17, 2004 at 06:10:56PM -0500, Tom Lane wrote:
> "news.postgresql.org" <[EMAIL
You can use plpythonu (or tcl or C or R) to do running
sums. For plpythonu, you must initialize the SD[]
by calling it first with the proper argument.
create or replace function runsum(int,int)
returns int as
'
if args[0] == 1:
SD["currval"] = 0
return SD["currval"]
else:
In this week's General Bits, we talk about using
large objects. Perhaps this might help you understand
what is involved with using them.
http://www.varlena.com/GeneralBits/
cheers,
[EMAIL PROTECTED]
On Thu, Sep 25, 2003 at 09:41:28AM +0530, Kumar wrote:
> Hi Friends,
>
> I am running Postgre
know, I know, send a patch.
--elein
On Thu, Jul 24, 2003 at 01:07:18AM -0400, Tom Lane wrote:
> elein <[EMAIL PROTECTED]> writes:
> > So, other than C, plperl or pltcl is the way to go.
> > As long as they can input generic composite types
> > (I wasn't sure
So, other than C, plperl or pltcl is the way to go.
As long as they can input generic composite types
(I wasn't sure of that, but I should have known),
they can access columns as array elements so you can
loop through them. And they'll tell you the number
of arguments. Ta da!
elein
O
will hang onto this problem and if either of
us finds a solution, I'd like to publish it in
general bits.
elein
On Wed, Jul 23, 2003 at 09:06:49AM -0400, Robert Treat wrote:
> On Tue, 2003-07-22 at 19:33, elein wrote:
> > You'll need to pass the values down to your
> > co
You'll need to pass the values down to your
concat function (which I suggest you don't call concat)
and have it return a text type.
What exactly is your problem? I must be missing something.
elein
On Tue, Jul 22, 2003 at 06:31:52PM -0400, Robert Treat wrote:
> given
>
> cr
22 matches
Mail list logo