On Nov 4, 2011, at 10:01, Russell Keane wrote:
> I’m trying to create a custom type (PostgreSQL 9.0) which will essentially
> auto truncate a string to a certain length.
>
>
>
>
>
> Can this be done purely in plpgsql?
>
> If so, how?
>
>
>
An explicit cast of a value to varchar(n) ca
I'm trying to create a custom type (PostgreSQL 9.0) which will essentially auto
truncate a string to a certain length.
The type (auto_trunc_char) will be used as follows:
Create table blah (
Some_name auto_trunc_char(40)
)
Can this be done purely in plpgsql?
If so, how?
I know
Hello
i note something related to this discussion
> create table mytmp(name myvarchar(10,"en_US"));
i meant that "en_US" is a locale name, then it means natural language and
also character encoding -- those both things are not a matter of SQL-TYPE at
all. It is wrong to represent application
On Nov 3, 2004, at 10:56 AM, Ameen - Etemady wrote:
I like to do it like this:
create table mytmp(name myvarchar(10,"en_US"));
you can't unless you modify the parser.
It has special cases to support varchar (and numeric) syntax.
--
Jeff Trout <[EMAIL PROTECTED]>
http://www.jefftrout.com/
http://ww
I want to create a data type that have tow arguments in the defenition,
like the varchar type:
create table mytmp(name varchar(10));
I like to do it like this:
create table mytmp(name myvarchar(10,"en_US"));
whow can it be done by "CREATE TYPE"
I want to implement the internal functions (compare,
Sascha Ziemann <[EMAIL PROTECTED]> writes:
> I would like to define a
> new type VARCHAR2 which should behave exactly like VARCHAR.
You could get about halfway there with
CREATE DOMAIN varchar2 AS varchar;
But it's only halfway because the domain will not accept length
decorations; that i
Hi,
I try to emulate with PostgreSQL an Oracle database. My problem is
that PostgreSQL does not support any Oracle specific types.
PostgreSQL provides the TEXT and Oracle uses the CLOB or VARCHAR2
type. I would like to use the CREATE TYPE statement to tell
PostgreSQL about the Oracle types, but
>
> I've seen the docs for create type and an example of the syntax to create a
> type. What I haven't seen is the functions that are passed for the input and
> output elements.
>
> CREATE TYPE box (INTERNALLENGTH = 8,
> INPUT = my_procedure_1, OUTPUT = my_procedure_2);
>
> Now what would
I've seen the docs for create type and an example of the syntax to create a
type. What I haven't seen is the functions that are passed for the input and
output elements.
CREATE TYPE box (INTERNALLENGTH = 8,
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
Now what would be in my_procedure1 a
Roberto Mello <[EMAIL PROTECTED]> writes:
> What would the functions my_procedure_1 and my_procedure_2 look like?
src/backend/utils/adt/ is full of examples of datatype I/O procedures.
Pick an existing type that does something vaguely like your type
(at the very least pick one that uses the same
On Tue, Jul 10, 2001 at 06:43:59PM +0200, Peter Eisentraut wrote:
>
> http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xtypes.html
Oh. So you have to write a function in C to use CREATE TYPE?
> This seems to be outdated regarding the fmgr update, though. (Hint,
> hint...)
Roberto Mello writes:
> I'm looking for some examples of how the functions for CREATE TYPE
> should be. There are none in the documentation, so I was hoping to find
> someone here that could help me.
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xtypes.html
This seems to be
I'm looking for some examples of how the functions for CREATE TYPE
should be. There are none in the documentation, so I was hoping to find
someone here that could help me.
For example, the documentation has this example:
CREATE TYPE box (INTERNALLENGTH = 8,
INPUT = my_procedur
I have a problem where I need to restrict queries by more than a million ids
that are the result of another program. Typically I would in the application
layer write those ids into an IN( ) clause, but that will not work for more
than 10,000 ids. So I need to load these ids into the db into some s
I'm trying to simulate domains in PostgreSQL using
the create type function, but I cannot find how the input and output functions
for standard types are called. Is there anyone who can help me ?
Thanks!
--Valerio
Santinelli
15 matches
Mail list logo