473,509 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4158
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
6487
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
3508
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
3033
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
2732
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
2160
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
2030
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
2228
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
3122
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
1158
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
2168
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
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.