472,982 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

Where are user-defined types stored/viewed

After I execute a command like

CREATE TYPE employee_wage_journal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to get
teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.

The new type DOES show up in the result when I run

select * from pg_type order by typname

but I see only the name itself (and a lot of "*id" columns that probably
reference something relevant), but I don't know how to get the actual
definition back so that I can use an existing type definition as the
basis for modification when application design changes are required.

~Berend Tober


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #1
3 4132
On Monday 29 September 2003 13:35, bt****@seaworthysys.com wrote:
After I execute a command like

CREATE TYPE employee_wage_journal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to get
teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.


In psql:
\d emplokee_wage_journal_sum

If you start psql with -E it will show you the query it uses to show this too.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2
<bt****@seaworthysys.com> writes:
After I execute a command like
CREATE TYPE employee_wage_journal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision); I don't see the new type show up anywhere in pgAdminII.
Probably not. Stand-alone composite types (like the above) are a new
feature in 7.3, and pgAdminII likely doesn't know about them.

You might try pgAdmin III, which just got out of beta I believe.
but I see only the name itself (and a lot of "*id" columns that probably
reference something relevant), but I don't know how to get the actual
definition back so that I can use an existing type definition as the
basis for modification when application design changes are required.


There's always "pg_dump -s" to extract such stuff.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #3
On Monday 29 September 2003 13:35, bt****@seaworthysys.com wrote:
After I execute a command like

CREATE TYPE employee_wage_journal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to
get teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.


In psql:
\d emplokee_wage_journal_sum

If you start psql with -E it will show you the query it uses to show
this too.

--
Richard Huxton
Archonet Ltd


Based on the output produced using your advice, I came up the the
following query to help me list my type definitions:

CREATE VIEW public.complex_types AS
SELECT
n.nspname,
c.relname,
a.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod),
a.attnotnull,
a.atthasdef,
a.attnum,
nspacl
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_catalog.pg_attribute a ON a.attrelid = c.relfilenode
WHERE pg_catalog.pg_table_is_visible(c.oid)
AND c.relkind = 'c'
ORDER BY
n.nspname,
c.relname,
a.attnum
~Berend Tober


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Cowfisher | last post by:
I can write simple MySQL stuff in PHP but I'm having problems putting in WHERE clauses. Everytime I do I get errors like this: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,...
20
by: David | last post by:
Hi, I have a field from my recordset called RS("Password"). If I wish to display each character as an asterix '*' how do I go about it. I've seen the replace function, but cannot work out how...
7
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex...
3
by: sean | last post by:
I have a table with fixed row of records SORTED by DATE using ADO pagination method. The user can click a link in one table cell and go to another page to modify the record. Once the updated record...
3
by: rreitsma | last post by:
I want to create a form that will allow the user to select from a list of available reports and based on a filter limit the records displayed in the report. I have figured out how to access the...
6
by: Liming | last post by:
Hi, In a typical 3 tier model (view layer, busines layer and data access layer) where do you handle your exceptions? do you let it buble up all the way to the .aspx pages or do you handle it in...
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
3
by: ckauvar | last post by:
I've got a SQL statement that has me stumped. Consider the following scenario: A donor gives the following gifts: in 2006 they give $250 in 2007 they give $550 in 2008 they give $50 My...
7
by: microgolf | last post by:
Hey, i have a question. i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a...
7
by: K Viltersten | last post by:
I've changed the declaration of the connection string in my application from String conStr = "the string"; to an external one, behaving as a property of my class (supposedly, a nicer...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.