pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ingrith Andrea Correa Vargas <i-correa@uniandes.edu.co>
To: pgsql-sql@postgreSQL.org
Subject: CREATE TABLE - DEFAULT
Date: Sat, 27 Feb 1999 16:35:23 -0500 (GMT+5)
Message-ID: <Pine.GSO.3.96.990227163049.9899A-100000@isis> (raw)



Hello again!

I have been receiving some mails asking my question about creating a table
with a default value as a user defined function, but I have a problem yet.

I hope somebody knows to solve my problem...
Thank you in advance! :)

//Ingrith

---||---

Te complete problem is:

---------------------------------------------------------
CREATE TABLE emp (code INT4
  , name VARCHAR(20)
  , salary INT4
  , 2salary INT4 default double_salary(emp)
);

CREATE FUNCTION double_salary(emp) RETURNS INT4
AS 'SELECT $1.salay * 2 AS result' LANGUAGE 'sql'
;

ERROR:  parser: syntax error at or near ")"
---------------------------------------------------------

Function double_salary receives an 'emp' , as you see, and there is the
error, because if I change parameter 'emp' by a number, the error doesn't
appear.

How can I do?!

The origin of this question is that I want to know if a subclass inherits
all atributtes from the parent, included functions like double_salary in
my example.





view thread (2+ messages)  latest in thread

Message-ID: <Pine.GSO.3.96.990227163049.9899A-100000@isis>
Permalink:  ../Pine.GSO.3.96.990227163049.9899A-100000@isis/
Also on:    postgresql.org/message-id/Pine.GSO.3.96.990227163049.9899A-100000@isis

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: i-correa@uniandes.edu.co
  Subject: Re: CREATE TABLE - DEFAULT
  In-Reply-To: <Pine.GSO.3.96.990227163049.9899A-100000@isis>
  References: <Pine.GSO.3.96.990227163049.9899A-100000@isis>

* 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