Sponsored Content
The Lounge What is on Your Mind? What is your favourite movie at the moment? Post 302573343 by vivek d r on Monday 14th of November 2011 07:33:32 AM
Old 11-14-2011
"CAST AWAY" its my all time favourite....
 

9 More Discussions You Might Find Interesting

1. OS X (Apple)

i Movie HD

i Movie HD will not play sound from an imported movie :confused: (2 Replies)
Discussion started by: fgjiu
2 Replies

2. UNIX for Dummies Questions & Answers

is there any way to know how much time process was running from the moment it started

i have process that was started few days ago , is there way to know by its id how long it was alive in the system ? Thanks (2 Replies)
Discussion started by: umen
2 Replies

3. Shell Programming and Scripting

Any one here this moment? (Ignore)

I have small question i should solve it (1 Reply)
Discussion started by: Ame
1 Replies

4. OS X (Apple)

OS 10 lässt sich nicht mehr installieren...ubuntu läuft als system im moment....hilfe!

hello, I have installed on my MacBookPro Ubuntu via Boot Camp, but bootcamp has deletet that MacOS partion and created just one new and installed ubuntu. Now I can not install MacOS 10 from the DVD, the gray screen comes when I use the "C" key during the boot process. it starts booting... (2 Replies)
Discussion started by: ingwio
2 Replies

5. Homework & Coursework Questions

2. Write a shell script that produces some summary information of the system at a particular moment

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 2. Relevant commands, code, scripts, algorithms: 3. The attempts at a solution (include all... (2 Replies)
Discussion started by: jsk319342
2 Replies

6. What is on Your Mind?

Favourite Games console

So what is everyones all time favourite games console and why do you like it? (Please - no comments on why they are better than others as that would be opinion based and cause arguments, positive comments only) (28 Replies)
Discussion started by: Tommyk
28 Replies

7. What is on Your Mind?

Your favourite computer games....

Hi all, there have been a tremendous evolution in the computer games from games like Tetris or DAVE or Prince of Persia or wolf3d... to Call of Duty or BattleField or tomb raider etc etc so let us know the games which you liked the most.... you can also mention about the gaming rig you... (32 Replies)
Discussion started by: vivek d r
32 Replies

8. Shell Programming and Scripting

Blond moment : sed

Hallo Team, I have thousands of lines and i would like to manilpute a pattern but i am getting an error: File lo0ks like below: ... (5 Replies)
Discussion started by: kekanap
5 Replies

9. UNIX Desktop Questions & Answers

Which is your favourite desktop?

Most of the people think that they can not use Unix as desktop. By this poll we gone tell them that we not just use Unix as desktop but also love different display managers like GNOME, KDE etc..... (35 Replies)
Discussion started by: ynilesh
35 Replies
CREATE 
CAST(7) SQL Commands CREATE CAST(7) NAME
CREATE CAST - define a user-defined cast SYNOPSIS
CREATE CAST (sourcetype AS targettype) WITH FUNCTION funcname (argtype) [ AS ASSIGNMENT | AS IMPLICIT ] CREATE CAST (sourcetype AS targettype) WITHOUT FUNCTION [ AS ASSIGNMENT | AS IMPLICIT ] DESCRIPTION
CREATE CAST defines a new cast. A cast specifies how to perform a conversion between two data types. For example, SELECT CAST(42 AS text); converts the integer constant 42 to type text by invoking a previously specified function, in this case text(int4). (If no suitable cast has been defined, the conversion fails.) Two types may be binary compatible, which means that they can be converted into one another ``for free'' without invoking any function. This requires that corresponding values use the same internal representation. For instance, the types text and varchar are binary compati- ble. By default, a cast can be invoked only by an explicit cast request, that is an explicit CAST(x AS typename), x::typename, or typename(x) construct. If the cast is marked AS ASSIGNMENT then it can be invoked implicitly when assigning to a column of the target data type. For example, supposing that foo.f1 is a column of type text, then INSERT INTO foo(f1) VALUES(42); will be allowed if the cast from type integer to type text is marked AS ASSIGNMENT, otherwise not. (We generally use the term assignment cast to describe this kind of cast.) If the cast is marked AS IMPLICIT then it can be invoked implicitly in any context, whether assignment or internally in an expression. For example, since || takes text arguments, SELECT 'The time is ' || now(); will be allowed only if the cast from type timestamp to text is marked AS IMPLICIT. Otherwise it will be necessary to write the cast explicitly, for example SELECT 'The time is ' || CAST(now() AS text); (We generally use the term implicit cast to describe this kind of cast.) It is wise to be conservative about marking casts as implicit. An overabundance of implicit casting paths can cause PostgreSQL to choose surprising interpretations of commands, or to be unable to resolve commands at all because there are multiple possible interpretations. A good rule of thumb is to make a cast implicitly invokable only for information-preserving transformations between types in the same general type category. For example, the cast from int2 to int4 can reasonably be implicit, but the cast from float8 to int4 should probably be assignment-only. Cross-type-category casts, such as text to int4, are best made explicit-only. To be able to create a cast, you must own the source or the target data type. To create a binary-compatible cast, you must be superuser (this restriction is made because an erroneous binary-compatible cast conversion can easily crash the server). "PARAMETERS" sourcetype The name of the source data type of the cast. targettype The name of the target data type of the cast. funcname(argtype) The function used to perform the cast. The function name may be schema-qualified. If it is not, the function will be looked up in the path. The argument type must be identical to the source type, the result data type must match the target type of the cast. Cast functions must be marked immutable or stable. WITHOUT FUNCTION Indicates that the source type and the target type are binary compatible, so no function is required to perform the cast. AS ASSIGNMENT Indicates that the cast may be invoked implicitly in assignment contexts. AS IMPLICIT Indicates that the cast may be invoked implicitly in any context. NOTES
Use DROP CAST to remove user-defined casts. Remember that if you want to be able to convert types both ways you need to declare casts both ways explicitly. Prior to PostgreSQL 7.3, every function that had the same name as a data type, returned that data type, and took one argument of a differ- ent type was automatically a cast function. This convention has been abandoned in face of the introduction of schemas and to be able to represent binary compatible casts in the catalogs. (The built-in cast functions still follow this naming scheme, but they have to be shown as casts in pg_cast now.) EXAMPLES
To create a cast from type text to type int4 using the function int4(text): CREATE CAST (text AS int4) WITH FUNCTION int4(text); (This cast is already predefined in the system.) COMPATIBILITY
The CREATE CAST command conforms to SQL99, except that SQL99 does not make provisions for binary compatible types. AS IMPLICIT is a Post- greSQL extension, too. SEE ALSO
CREATE FUNCTION [create_function(7)], CREATE TYPE [create_type(7)], DROP CAST [drop_cast(7)], PostgreSQL Programmer's Guide SQL - Language Statements 2002-11-22 CREATE CAST(7)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy