pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Cristian Cappo <ccappo@cnc.una.py>
Cc: pgsql-sql@postgresql.org
Subject: Re: How access  to array component
Date: Sat, 19 Jul 2003 20:04:20 -0700
Message-ID: <3F1A06B4.6090301@joeconway.com> (raw)
In-Reply-To: <3F180992.5070400@cnc.una.py>
References: <3F180992.5070400@cnc.una.py>

Cristian Cappo wrote:
>  >>>  select __function(10::int2, 20::int2)[1]
>                       ^^^ parsing error.
> 

Try:

create or replace function foo(int2, int2 ) returns _varchar as '
select ''{1,2}''::_varchar
' language 'sql';

regression=# select (foo(10::int2, 20::int2))[1];
  foo
-----
  1
(1 row)

HTH,

Joe




view thread (5+ messages)  latest in thread

Message-ID: <3F1A06B4.6090301@joeconway.com>
Permalink:  ../3F1A06B4.6090301@joeconway.com/
Also on:    postgresql.org/message-id/3F1A06B4.6090301@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@joeconway.com, ccappo@cnc.una.py
  Subject: Re: How access  to array component
  In-Reply-To: <3F1A06B4.6090301@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox