This worked.
Thank you all!
I know the casting is quite basic operation but could this be added to
the CREATE VIEW documentation? Now there is only an example:
CREATE VIEW vista AS SELECT text 'Hello World' AS hello;
The same syntax won't work with other type as Tom wrote.
-Lauri
On Wed, Oct 5,
Lauri Kajan writes:
> This works with other values but not with nulls:
> CREATE VIEW view1 AS
> SELECT
> attribute1 as a1,
> text null as a2,
> text 'test' as a3
> FROM
> table;
FYI, the syntax typename 'literal' works *only* with string literals,
not anything else. For any other targ
On Wed, Oct 05, 2011 at 05:22:21PM +0300, Lauri Kajan wrote:
> Hi all,
>
> How could I create a view that returns null values among all other values.
> Here is a sample that i want to achieve:
>
> CREATE VIEW view1 AS
> SELECT
> attribute1 as a1,
> null as a2
> FROM
> table;
>
> Now the pr
try:
CREATE OR REPLACE VIEW view1 AS
SELECT
name as a1,
null::text as a2,
'test'::text as a3
FROM
some_table;
Στις Wednesday 05 October 2011 17:22:21 ο/η Lauri Kajan έγραψε:
> Hi all,
>
> How could I create a view that returns null values among all other values.
> Here is a sample that i
Hi all,
How could I create a view that returns null values among all other values.
Here is a sample that i want to achieve:
CREATE VIEW view1 AS
SELECT
attribute1 as a1,
null as a2
FROM
table;
Now the problem is that I got an warning: column "a2" has type "unknown"
I know that I should de
On Sep 29, 2008, at 4:59 AM, Chris wrote:
Matthew Wilson wrote:
I'm trying to comprehend how NULL values interact with unique
indexes.
It seems like I can insert two rows with NULL values in a column
with a
unique constraint just fine.
Is there something special about NULL? Can anyone post
You can always add a constraint that these columns cannot be NULL
themselves. That removes this problem.
On Sep 28, 2008, at 11:17 PM, Klint Gore <[EMAIL PROTECTED]> wrote:
Matthew Wilson wrote:
I'm trying to comprehend how NULL values interact with unique
indexes.
It seems like I can inser
Matthew Wilson wrote:
I'm trying to comprehend how NULL values interact with unique indexes.
It seems like I can insert two rows with NULL values in a column with a
unique constraint just fine.
Is there something special about NULL? Can anyone post some links to
explain what is going on?
h
Matthew Wilson <[EMAIL PROTECTED]> writes:
> It seems like I can insert two rows with NULL values in a column with a
> unique constraint just fine.
This is per SQL spec and quite well-documented in our manual ...
regards, tom lane
--
Sent via pgsql-general mailing list (
Matthew Wilson wrote:
I'm trying to comprehend how NULL values interact with unique indexes.
It seems like I can insert two rows with NULL values in a column with a
unique constraint just fine.
Is there something special about NULL? Can anyone post some links to
explain what is going on?
When
I'm trying to comprehend how NULL values interact with unique indexes.
It seems like I can insert two rows with NULL values in a column with a
unique constraint just fine.
Is there something special about NULL? Can anyone post some links to
explain what is going on?
Here's the example that stump
Richard Huxton wrote:
Sergey Karin wrote:
Are there any abilities to represent NULL values as string?
Null isn't a real value. Try not to think of it as a value.
That being said, and with due credit elsewhere (http://www.varlena.com/varlena/GeneralBits/84.php), what I do is
CREATE OR R
Sergey Karin wrote:
Hi, List!
I'm using PG8.1.
Are there any abilities to represent NULL values as string?
Null isn't a real value. Try not to think of it as a value.
http://archives.postgresql.org/pgsql-sql/2003-01/msg00222.php
num_value alias for $1;
string_value := \'input val
Sergey Karin schrieb:
Hi, List!
I'm using PG8.1.
Are there any abilities to represent NULL values as string?
I'm doing something like this:
create function func(int4) returns varchar as'
declare
num_value alias for $1;
string_value varchar;
begin
string_value := \'input value =
Hi, List!
I'm using PG8.1.
Are there any abilities to represent NULL values as string?
I'm doing something like this:
create function func(int4) returns varchar as'
declare
num_value alias for $1;
string_value varchar;
begin
string_value := \'input value = \' || num_value;
ret
On Tue, Jul 10, 2001 at 09:40:31AM +0100, Mark Muffett wrote:
> Is there a Postgresql equivalent to the Oracle NVL( ) function,
> which allows a SELECT statement to fill in default values if a
> column is NULL?
Yes.
Use the DEFAULT keyword while creating the table.
That is:
CREATE TABLE ac
16 matches
Mail list logo